linq 时间无法转换格式问题

使用这个函数:

清除时间部分,保留日期部分

DbFunctions.TruncateTime(时间)

代码示例:

var query = from a in context.Table
                            where DbFunctions.TruncateTime(a.EndTime) == DbFunctions.TruncateTime(now)

  

猜你喜欢

转载自www.cnblogs.com/LessIsMoreZ/p/12605160.html