asp.net mvc - Entity version in odata using accept header in web api -
i using web api create restful services. decided using accept header api versioning mechanism following implementation. http://blog.maartenballiauw.be/post/2013/03/08/custom-media-types-for-aspnet-web-api-versioning.aspx
accept: application/json; version=1
for entity standardization , query capabilities, planned use odata. problem see odata supports(or know) entity versioning using url.
modelbuilder1.entityset<v1.product>("products"); modelbuilder2.entityset<v2.product>("products"); microsoft.data.edm.iedmmodel model1 = modelbuilder1.getedmmodel(); microsoft.data.edm.iedmmodel model2 = modelbuilder2.getedmmodel(); config.routes.mapodataroute("odataroute1", "api\v1", model1); config.routes.mapodataroute("odataroute2", "api\v2", model2);
is there solution available configure odata consider accept header ?
thanks in advance.
we have sample on versioning using web api odata. can find here
Comments
Post a Comment