You can do the following:
public bool Between(DateTime value, DateTime from, DateTime To) { return value > from && value < to; } where Between(a.StopDateActual, monthBeginDate, monthEndDate)
However, you should notice that this works on IEnumerable , not on IQueryable , that is, the results will be pulled from the data source before it is applied. This can be a performance issue in case of a lot of data, so your classification is the best you can do ... just be careful s> and <!!!
source share