Uso EF 6 quando DbFunctions.TruncateTime
questo codice anche usando DbFunctions.TruncateTime
var touches = analyticRepo.GetAll()
.Where(x => DbFunctions.TruncateTime(x.DateCreated.Date) == report.DateCreated.Date);
var test = touches.ToList();
Ottengo questo errore:
Il membro del tipo specificato 'Data' non è supportato in LINQ to Entities. Sono supportati solo inizializzatori, membri entità e proprietà di navigazione entità.
Qualche idea su come risolverlo.
Puoi inserire la data in una variabile:
var reportDate = report.DateCreated.Date;
var touches = analyticRepo.GetAll()
.Where(x => DbFunctions.TruncateTime(x.DateCreated) == reportDate);
var test = touches.ToList();