locked
Web API OData support RRS feed

  • Question

  • User990771509 posted

    I am having one hell of a time getting OData to play nicely with the web services I am building. I have tried the examples provided by Microsoft and others on creating OData service endpoints and every single time something goes wrong. It is either only returning the key for a model or throwing odd exceptions about maxTop being 0 when I have it set to be 100.

    I was wondering if anyone had a full working example (preferably with entity framework) that they would be willing to share so I could see what I am doing wrong.

    Thanks in advance for any help you can give me,

    ~Justin R. 

    Friday, March 3, 2017 5:39 PM

Answers

  • User-2057865890 posted

    Hi Justin,

    It is either only returning the key for a model or throwing odd exceptions about maxTop being 0 when I have it set to be 100.

    What is the exact error message?

    I was wondering if anyone had a full working example (preferably with entity framework) that they would be willing to share so I could see what I am doing wrong.

    This article demonstrates how to create an OData V4 Web API service which uses Entity Framework 6 and SQL 2014 for persistence.

    https://damienbod.com/2014/06/10/getting-started-with-web-api-and-odata-v4/

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 6, 2017 1:35 AM

All replies

  • User-2057865890 posted

    Hi Justin,

    It is either only returning the key for a model or throwing odd exceptions about maxTop being 0 when I have it set to be 100.

    What is the exact error message?

    I was wondering if anyone had a full working example (preferably with entity framework) that they would be willing to share so I could see what I am doing wrong.

    This article demonstrates how to create an OData V4 Web API service which uses Entity Framework 6 and SQL 2014 for persistence.

    https://damienbod.com/2014/06/10/getting-started-with-web-api-and-odata-v4/

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 6, 2017 1:35 AM
  • User990771509 posted

    Thank you very much Chris I ended up resolving my issues. 

    I had a follow up question if anyone knows the answer to it. 
    I am trying to generate edit links in the OData Entity Data Model, but I am hoping to implement some business logic on whether or not a record is editable by a user. Is there a way of doing this or is this not recommended. 

    Thank you again for any help that can be provided. 

    Monday, March 6, 2017 11:11 PM