Linq generic Expression in query on "element" or on IQueryable (multiple use)
- by Bogdan Maxim
Hi,
I have the following expression
public static Expression<Func<T, bool>> JoinByDateCheck<T>(T entity, DateTime dateToCheck) where T : IDateInterval
{
return (entityToJoin) =>
entityToJoin.FromDate.Date <= dateToCheck.Date && (entityToJoin.ToDate == null || entityToJoin.ToDate.Value.Date >=…