I have written a apicontroller class that supports ODATA by using the EnableQuery attribute on the methods and returning the data asQueryable. It alls works fine for me. What use is the ODataConventionModelBuilder? Do I still need to use it?
1 Answer
The using of ODataConventionModelBuilder enables
- The mapping from your POCO classes to the OData model including handling primitive types, complex types, entities types and relationships between them, actions, function, and so on.
- It also helps validate if you have a correct OData model.
- It helps set up the metadata document and service document.
If you really want to expose an OData service that conforms the OData protocol, you would need to do a lot yourselves without the ODataConventionModelBuilder. But if you don't care about things like conforming model conventions or exposing the service model to the service consumers, you may not use it.