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());
{
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;