简体   繁体   中英

ODataConventionModelBuilder usage

Apart from auto mapping CLR Classes to EDM models, what are the advantages or use-cases for the ODataConventionModelBuilder ?

What specific set of pains does it make go away? With sample code if possible.

ODataConventionModelBuilder is used for generating the Entity Data Model (EDM) for your OData service. The main purpose of EDM is used to define the type system, relationships and the actions that can be exposed by your OData service model.

If you are looking for a specific example, see this link - http://bitoftech.net/2014/04/16/create-read-only-odata-endpoint-using-asp-net-web-api/

In general OdataConventionModelBuilder is preferred over ODataModelBuilder since it infers the inheritance hierarchies, navigation properties and standard properties.

Also look at this link - http://blogs.msdn.com/b/alexj/archive/2012/11/02/odata-in-webapi-microsoft-asp-net-web-api-odata-0-2-0-alpha-release.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM