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 included by adding the Microsoft.AspNet.WebApi.OData NuGet package and adding .AsQueryable (); as a type of response. This allows you to support query string parameters such as? $ Filter = Name eq 'Martin' to filter the results.

However, there seems to be no .net 5 version of this NuGet package and .AsQueryable () does not work right out of the box.

Does it now appear in another package for RC1, or is it soon or not the way we do it in ASP.NET 5?

+5
source share
1 answer

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

This is OData V4 for Asp.Net 5, however it is developing.

+4
source

Source: https://habr.com/ru/post/1237914/


All Articles