Search code examples
c#entity-frameworkasp.net-web-apiodata

Where to find the translated OData query?


I want to know where is the translated OData query when I hit for example http://www.com/api/product?$filter=Id%20eq%206. OData query translate these query to SQL code or query expression or something else?

Actually, I want to know the Life Cycle of OData.


Solution

  • You can add a parameter of type System.Web.OData.Query.ODataQueryOptions to the Get() method on your controller. It will give you a strongly-typed object model for most query options, including $filter. See Supporting OData Query Options in ASP.NET Web API 2 for details.