ODataConventionModelBuilder usage
Asked Answered
H

1

7

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.

Horologe answered 29/8, 2013 at 21:48 Comment(0)
L
3

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

Legionary answered 10/6, 2015 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.