2

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 1

4

The using of ODataConventionModelBuilder enables

  1. 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.
  2. It also helps validate if you have a correct OData model.
  3. 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.