OData开发者_如何学Go services expose their metadata:
http://www.odata.org/blog/queryable-odata-metadata
What's the best way to programmatically get the metadata. Of course, I could query using XDocument. Is there a better way?
Currently there's no higher level API in .NET for consuming the $metadata response. XLinq is probably the best option. You can use the site from the post to vote for such a feature in the future release: http://blogs.msdn.com/b/astoriateam/archive/2010/09/10/what-do-you-want-to-see-added-changed-in-wcf-data-services.aspx
You can use the EdmxReader class from Microsoft.Data.Edm to parse the $metadata document in to an EDM model. You can get the nuget package for EdmLib from this location.
精彩评论