OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
855 stars 473 forks source link

Entity Query Date propertie #1670

Open hbdbim opened 6 years ago

hbdbim commented 6 years ago

when triggered the query I see in the sql profiler: ((((DATEPART (year, [Extent1].[Date])) * 10000) + ((DATEPART (month, [Extent1].[Date])) * 100) + (DATEPART (day, [Extent1].[Date]))) >= ((@p__linq__0 * 10000) + (@p__linq__1 * 100) + @p__linq__2))

Sounds pretty bad to me.

Is that right or am I doing something wrong?

raheph commented 6 years ago

@hbdbim That's by design. Edm.Date and the corresponding CLR "Date" are defined in ODL. The DB doesn't know how to process this type. Is there any performance from your side?