From b86c2778859d94ba729b2d3c86ff514dda77140d Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Mon, 7 Oct 2024 11:11:45 +0200 Subject: [PATCH] fixqup queryable date filter --- Utils/Extensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/Extensions.cs b/Utils/Extensions.cs index 47747c2..c42c2de 100644 --- a/Utils/Extensions.cs +++ b/Utils/Extensions.cs @@ -93,7 +93,7 @@ public static class Extensions } [Projectable] - public static IQueryable ApplyDateOnlyFrameQ(this IQueryable query, Func dateAcessor, DateOnlyFrame frame) => query.Where(e => dateAcessor(e) >= frame.fromDate && dateAcessor(e) <= frame.toDate); + public static IQueryable ApplyDateOnlyFrameQ(this IQueryable query, string datePropery, DateOnlyFrame frame) => query.Where(e => EF.Property(e, datePropery) >= frame.fromDate && EF.Property(e, datePropery) <= frame.toDate); [Projectable] public static IEnumerable ApplyDateOnlyFrameE(this ICollection query, Func dateAcessor, DateOnlyFrame frame) => query.Where(e => dateAcessor(e) >= frame.fromDate && dateAcessor(e) <= frame.toDate);