From 5469e88b616383aceb77d2ec7092f5acb024db8e Mon Sep 17 00:00:00 2001 From: Alberto Milani Date: Wed, 24 Aug 2022 16:02:56 +0200 Subject: [PATCH] Implemented workaround to avoid issue: https://github.com/ninjanye/SearchExtensions/issues/40 as suggested by FWest98 --- NinjaNye.SearchExtensions/ApplyExtension.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 NinjaNye.SearchExtensions/ApplyExtension.cs diff --git a/NinjaNye.SearchExtensions/ApplyExtension.cs b/NinjaNye.SearchExtensions/ApplyExtension.cs new file mode 100644 index 0000000..7fee719 --- /dev/null +++ b/NinjaNye.SearchExtensions/ApplyExtension.cs @@ -0,0 +1,19 @@ +using System.Linq; + +namespace NinjaNye.SearchExtensions +{ + /// + /// Added to normalize IQueryable to prevent "The source IQueryable doesn't implement IAsyncEnumerable" excpetion + /// https://github.com/ninjanye/SearchExtensions/issues/40 + /// + public static class ApplyExtension + { + public static IQueryable Apply(this QueryableSearchBase source) { + return source.Where(source.AsExpression()); + } + + public static IQueryable Apply(this QueryableChildSearchBase source) { + return source.Where(source.AsExpression()); + } + } +}