DateTime dateTimeNow = DateTime.UtcNow;
DateTime dateTomorrow = dateTimeNow.Date.AddDays(1);
return db.EventCustoms.Where(x => x.DataTimeStart < dateTomorrow)
.Select(y => new { y.EventId, y.EventTitle, y.DataTimeStart });
[Edit] @GibboK To clarify a bit:
Entity Framework cannot translate the Date property of a DateTime object on the database side.
Your options:
(1) (As stated above) Rethink your query and try a solution that does not require a function call on the database side for each row in your table .... which is good for query performance.
(2), , EntityFunctions, ( TruncateTime), EF .
.
return db.EventCustoms
.Where(x => EntityFunctions.TruncateTime(x.DataTimeStart) <= dateNow)