Search code examples
entity-frameworkodatawebapi2

Can we use Odata in Web API? Is it going to live longer


We have a WCF Odata Service enabled. We are planning to migrate to Web API2. I was told we are not going to user Odata.

Could someone enlighten me on, why shouldn't we use Odata. Is it going to obsolete soon. What are the downsides of using it, and can we use it without Entity Framework. Please suggest a good tutorial. Thanks.


Solution

  • This article https://learn.microsoft.com/en-us/aspnet/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint was written less than a month ago, so I can't see any reason why you couldn't use Odata in Web API2. Shouldn't is just an opinion and not really what this site is for. I'd recommend asking whoever made the decision for their reasons.

    As for a good tutorial, the article I just linked seems like a fairly good place to start.

    From the article:

    Web API OData does not require EF. Use any data-access layer that can translate database entities into models.