linq中日期格式转换或者比较,程序报错说不支持方法的解决办法

public void TestMethod1()
{
using (var _context = new hotelEntities())
{
var rq = DateTime.Now.Date;
var query = from q in _context.UV_RZJL_RZRY_Single
where SqlFunctions.DateDiff("day",rq,q.LDRQ)>0
select q;
Assert.Inconclusive(query.Count().ToString()); 


}


可以用SqlFunctions,命名空间using System.Data.Objects.SqlClient;

 

posted @ 2017-05-26 18:09  sharestone  阅读(1276)  评论(0编辑  收藏  举报