fixqup queryable date filter

This commit is contained in:
honzapatCZ 2024-10-07 11:11:45 +02:00
parent 229525ab81
commit b86c277885

View File

@ -93,7 +93,7 @@ public static class Extensions
} }
[Projectable] [Projectable]
public static IQueryable<TType> ApplyDateOnlyFrameQ<TType>(this IQueryable<TType> query, Func<TType, DateOnly> dateAcessor, DateOnlyFrame frame) => query.Where(e => dateAcessor(e) >= frame.fromDate && dateAcessor(e) <= frame.toDate); public static IQueryable<TType> ApplyDateOnlyFrameQ<TType>(this IQueryable<TType> query, string datePropery, DateOnlyFrame frame) => query.Where(e => EF.Property<DateOnly>(e, datePropery) >= frame.fromDate && EF.Property<DateOnly>(e, datePropery) <= frame.toDate);
[Projectable] [Projectable]
public static IEnumerable<TType> ApplyDateOnlyFrameE<TType>(this ICollection<TType> query, Func<TType, DateOnly> dateAcessor, DateOnlyFrame frame) => query.Where(e => dateAcessor(e) >= frame.fromDate && dateAcessor(e) <= frame.toDate); public static IEnumerable<TType> ApplyDateOnlyFrameE<TType>(this ICollection<TType> query, Func<TType, DateOnly> dateAcessor, DateOnlyFrame frame) => query.Where(e => dateAcessor(e) >= frame.fromDate && dateAcessor(e) <= frame.toDate);