Use DbFunctions to solve asp.net mvc ef packet data by date

It follows a table

To date MyDate part of the group, we find the following lines will be reported abnormal

So how can the correct linq sql statement into it, it is necessary to use a tool like this DbFunctions

Go to the definition of this type can be seen in entityframework.dll class library

Replace DbFunctions query methods, see query packet information Success

 

   Conditions may also be converted

 

 

It follows a table

To date MyDate part of the group, we find the following lines will be reported abnormal

So how can the correct linq sql statement into it, it is necessary to use a tool like this DbFunctions

Go to the definition of this type can be seen in entityframework.dll class library

Replace DbFunctions query methods, see query packet information Success

 

Guess you like

Origin www.cnblogs.com/pengchong/p/12447256.html