Convert OData Uri to its equivalent Linq expression

I am creating a WCF service that results in a non-strict OData feed (for complex reasons, business strategies, etc.). In addition, the URL format is slightly different from OData, although most of its functions are very similar.

How can I convert a URI to a Linq expression tree ?.

Thanks in advance.

+5
source share
3 answers

Take a look at Linq2Rest - https://bitbucket.org/jjrdk/linq2rest . It parses an OData query in a LINQ expression, and vice versa. It is also available for Nuget.

+5
source

. ( , ). OData? , , , .

+2

You can use the following nuget package: https://www.nuget.org/packages/Community.OData.Linq

It allows you to use OData text query parameters in linq expresson for any IQuerable without ASP.NET dependency

var result = query.OData().Filter("Id eq 1 or Name eq 'n3'").OrderBy("Name desc").ToArray();
0
source

All Articles