时间比较
适用sqlserver
public static int? DateDiff(string datePartArg, System.DateTimeOffset? startDate, System.DateTime? endDate)
System.Data.Entity.SqlServer.SqlFunctions 的成员
System.Data.Entity.SqlServer.SqlFunctions.DateDiff("day", d.endtime.Value, sel_strtime)
例子:
predicate = predicate.And(d => System.Data.Entity.SqlServer.SqlFunctions.DateDiff("day", '2017-04-01', '2017-04-21') <= 0);
System.Data.Entity.SqlServer.SqlFunctions.DateDiff("dd", "2017-04-01", "2017-04-21") == 20天
oracle可直接比较