Skip to content

Commit

Permalink
Implemented workaround to avoid issue: ninjanye#40
Browse files Browse the repository at this point in the history
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.
19 changes: 19 additions & 0 deletions NinjaNye.SearchExtensions/ApplyExtension.cs
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());
}
}
}

0 comments on commit 5469e88

Please sign in to comment.