After a while I figured out the trick (using SetEdmVersion):
var eModel = new Microsoft.Data.Edm.Library.EdmModel();
...
eModel.SetEdmVersion(new Version(1, 0));
Question
When I use ODataLib 5.6.1 to generate an OData metadata document like this:
var eModel = new Microsoft.Data.Edm.Library.EdmModel();
....
...WriteMetadataDocument()
....
I get the following xml:
edmx document 1:
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx" Version="3.0">
...
</edmx:Edmx>
However this metadata (http://services.odata.org/V3/OData/OData.svc/$metadata) has a different schema:
edmx document 2:
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">
...
</edmx:Edmx>
How can I generate metadata looking like the document 2? My motivation is that many OData clients (e.g. Visual Studio's "Add Service Reference") don't seem to recognize the document 1.
Solution
After a while I figured out the trick (using SetEdmVersion):
var eModel = new Microsoft.Data.Edm.Library.EdmModel();
...
eModel.SetEdmVersion(new Version(1, 0));