asp.net mvc - WebApi OData Metadata / Description -
i using new 2012.2 odata stuff (microsoft asp.net web api odata) , following basic examples. have basic poco , being "magically" exposed via mvc site @ /odata:
odatamodelbuilder modelbuilder = new odataconventionmodelbuilder(); modelbuilder.entityset<job>("products"); microsoft.data.edm.iedmmodel model = modelbuilder.getedmmodel(); config.routes.mapodataroute("odataroute", "odata", model);
this seems magically wire odata "service" description file , calls products controller formatted nicely atom.
my question has poco, description , metadata. there magic going on here don't know find documentation. able to:
provide "description" property entities (excel 2013 shows during data connection wizard)
override class name of poco user friendly name. , bonus, allow me dynamically set on-the-fly.
i don't know generating "/odata/magic.svc" file, don't know how find documentation on it. webapi, odata, entityframework?
thanks!
there no magic.svc gets generated. have done 3 steps required building odata service. refer tutorial , blog post details.
when did,
datamodelbuilder modelbuilder = new odataconventionmodelbuilder(); modelbuilder.entityset<job>("products"); microsoft.data.edm.iedmmodel model = modelbuilder.getedmmodel();
you have built edm model odata service.
when did,
config.routes.mapodataroute("odataroute", "odata", model);
you telling web api expose odata service @ ~/odata/ (second argument) using service model have built.
and when trying fetch url ~/odata/products, odata route have added knows trying access products entity set , routes productscontroller. try blog post conventions odataconventionmodelbuilder uses , default odata routing conventions.
and regarding other 2 questions,
1) there no out-of-the-box support providing atom metadata. but, can override atom metadata using nightly drops added extensiblity points odata formatter. refer answer details.
2) don't support aliasing right now. so, no luck there. 1 of top items in our future plans though.
Comments
Post a Comment