Search code examples
asp.netasp.net-web-apiodataasp.net-web-api2asp.net-core

How to enable OData in ASP.Net 5 Web API


Is there any way to get OData query syntax in ASP.net 5 Web API (RC1 as I write).

In ASP.net 4.x this is enabled by adding the Microsoft.AspNet.WebApi.OData NuGet package and adding .AsQueryable(); as the response type. This enables support for query string params like ?$filter=Name eq 'Martin' to filter the results.

However there does not seem to be a .net 5 version of that NuGet package and .AsQueryable() does not work straight out of the box.

Does this exist now in another package for RC1 or is this coming soon or is not the way we do this kind of thing in ASP.NET 5?


Solution

  • please refer to : https://github.com/OData/WebApi/tree/vNext

    It's OData V4 for Asp.Net 5, however it's on developing.