How to find a date with a list of specified date ranges in Entity Framework?
问题 I have an IEnumerable of a class that I created to contain date ranges. That class looks like this: public class Range<T> where T: struct { public T Start { get; set; } public T End { get; set; } } I want to find all the records in my set where a date column falls within ANY of the specified date ranges. This was my attempt: deals = deals.Where( deal => criteria.DateRanges.Any( dt => deal.CloseDate >= dt.Start && deal.CloseDate < dt.End.Value.AddDays(1))); This throws an error I assume