Entity Framework Date rang query is not same as like LINQ.
You can try like this
var events = this.coreDomainContext.Events.Where(
e => EntityFunctions.TruncateTime(e.EventDate.Value) >= DateTime.Today
&& EntityFunctions.TruncateTime(e.EventDate.Value) <= EntityFunctions.TruncateTime(endPeriod))
.OrderByDescending(e => e.EventDate)
.ToList();
For details you can See
Nice thank you.
ReplyDelete