Problem Background
I'm building a custom WCF Data Service provider using the Alex James set of posts as a basis. My provider works with un-typed entities and sits on top of our own ORM Entity definition framework.
Although I've had a lot of success covering all of the main requirements we've got, I've hit a wall when it comes to defining auto-generated properties in the exposed $metadata page. (The $metadata page is automatically generated by .NET Framework from the internal representation of the metadata - I don't define the document content directly).
Examining the $metad开发者_如何学运维ata page for a standard WCF Data Service on top of a simple EF model, you get something like:
<Property Name="ID" Type="Edm.Int16" Nullable="false" p8:StoreGeneratedPattern="Identity"/>
with the StoreGeneratedPattern attribute letting the consumers know about the auto-generation for the given field.
The Specific Problem
My problem is that, in my custom un-typed world, I can't get find the hook to get the StoreGeneratedPattern attribute into my metadata. I'm looking around IDataServiceMetadataProvider and the System.Data.Services.* namespaces but I'm completely stumped.
There is no way currently to specify custom annotations with untyped providers in WCF data services. This is a known feature that is getting asked by a lot of customers. Here's the list to the voting site where you can vote for your favorite feature: http://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions
Thanks Pratik
精彩评论