> System.NotSupportedException:“The specified type member 'Date' is not
supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.”
I use EntityFramework6 to Query from Sqlie,there is some worng about dateTime.
var test = DateTime.Now.Date;
var maxEntity=_baseService.GetList<TestNoMapping>(o => o.LastChangeTime.Date == test)
.OrderByDescending(o => o.SampleId)
.FirstOrDefault();
public class BaseService
{
private readonly BaseContext _baseContext = new BaseContext();
public List<T> GetList<T>(Expression<Func<T, bool>> where) where T : class
{
return _baseContext.Set<T>().Where(where).ToList();
}
the DbFunctions.TruncateTime
I have try,But it doesn't work