如何在 linq to entity 中写Mysql 能识别的日期函数语句
以下是:Sql server
using System.Data.Entity;
var a = from x in EFContext.WM_ServiceRecord
where x.WMSRecord_CreateTime >= startTime && x.WMSRecord_CreateTime <= endTime
select new { useTime = DbFunctions.AddMinutes(DbFunctions.TruncateTime(x.WMSRecord_CreateTime), DbFunctions.DiffMinutes(DbFunctions.TruncateTime(x.WMSRecord_CreateTime), x.WMSRecord_CreateTime) / 5 * 5), WMSRecord_ServiceCode = x.WM_Method.WM_Service.WMService_Code };