You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Queries that using Predicate Builder been working in .Net Core 2.2 are now with 3.0 broken
For example the query below
var x = 1;
var result = new [] { 2, 3, 4, 5 }
var or = PredicateBuilder.False<Model>();
foreach (var xx in result)
or = PredicateBuilder.Or(or, x => x.Id == xx);
var cases = await _context.RuleIndexes.Where(x => x.Id != x)
.Where(or)
.ToListAsync();
*ignore the used predicates; they dont make any sense but removed the real ones for simplicity as the problem is in the PredicateBuilder.Or
Expected result would be the queryies would still run. Now result in an exception
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The LINQ expression 'Where(
source: Where(
source: DbSet,
predicate: (r) => r.CaseId != (Unhandled parameter: __caseId_0)),
predicate: (r) => False || Invoke(x => (((__xx_RuleId_1 == x.RuleId) AndAlso (__xx_Min_2 <= x.Value)) AndAlso (__xx_Max_3 >= x.Value)), r[RuleIndex])
)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync()
somewhat related to #15670 but it breaks existing code which is really painful
The text was updated successfully, but these errors were encountered:
Queries that using Predicate Builder been working in .Net Core 2.2 are now with 3.0 broken
For example the query below
*ignore the used predicates; they dont make any sense but removed the real ones for simplicity as the problem is in the PredicateBuilder.Or
Expected result would be the queryies would still run. Now result in an exception
somewhat related to #15670 but it breaks existing code which is really painful
The text was updated successfully, but these errors were encountered: