forked from ninjanye/SearchExtensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented workaround to avoid issue: ninjanye#40
as suggested by FWest98
- Loading branch information
Alberto Milani
committed
Aug 24, 2022
1 parent
794da67
commit 5469e88
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Linq; | ||
|
||
namespace NinjaNye.SearchExtensions | ||
{ | ||
/// <summary> | ||
/// Added to normalize IQueryable to prevent "The source IQueryable doesn't implement IAsyncEnumerable" excpetion | ||
/// https://github.com/ninjanye/SearchExtensions/issues/40 | ||
/// </summary> | ||
public static class ApplyExtension | ||
{ | ||
public static IQueryable<TSource> Apply<TSource, TProperty>(this QueryableSearchBase<TSource, TProperty> source) { | ||
return source.Where(source.AsExpression()); | ||
} | ||
|
||
public static IQueryable<TParent> Apply<TParent, TChild, TProperty>(this QueryableChildSearchBase<TParent, TChild, TProperty> source) { | ||
return source.Where(source.AsExpression()); | ||
} | ||
} | ||
} |