user380719
user380719

Reputation: 9923

Is there an API to query OData meta data

OData 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?

Upvotes: 0

Views: 947

Answers (2)

RaghuRam Nadiminti
RaghuRam Nadiminti

Reputation: 6793

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.

Upvotes: 0

Vitek Karas MSFT
Vitek Karas MSFT

Reputation: 13320

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

Upvotes: 1

Related Questions