LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' method

时间:2023-03-08 16:38:50

System.Data.Objects.EntityFunctions和System.Data.Objects.SqlClient.SqlFunctions中的方法进行比较,如下

where System.Data.Objects.SqlClient.SqlFunctions.DateDiff("s",DateTime.Now,u.Time)>0

where System.Data.Objects.EntityFunctions.DiffSeconds(DateTime.Now,u.Time)>0