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
Here is what to include in your request to make sure we implement a solution as quickly as possible.
1. Description
When mixing EF Core, LinqKit's Expandable, and Linq Dynamic, Linq dynamic will infinitely recurse in DefaultQueryAnalyzer.SupportsLinqToObjects.
2. Exception
If you are seeing an exception, include the full exception details (message and stack trace).
at System.Linq.Dynamic.Core.DefaultQueryableAnalyzer.SupportsLinqToObjects(System.Linq.IQueryable, System.Linq.IQueryProvider)
at System.Linq.Dynamic.Core.DefaultQueryableAnalyzer.SupportsLinqToObjects(System.Linq.IQueryable, System.Linq.IQueryProvider)
at System.Linq.Dynamic.Core.DefaultQueryableAnalyzer.SupportsLinqToObjects(System.Linq.IQueryable, System.Linq.IQueryProvider)
... the above is repeated ad infinitum until the program crashes.
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.SupportsLinqToObjects(System.Linq.Dynamic.Core.ParsingConfig, System.Linq.IQueryable)
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(System.Linq.IQueryable, System.Linq.Dynamic.Core.ParsingConfig, System.String, System.Object[])
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Linq.IQueryable`1<System.__Canon>, System.Linq.Dynamic.Core.ParsingConfig, System.String, System.Object[])
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Linq.IQueryable`1<System.__Canon>, System.String, System.Object[])
at Program.<Main>$(System.String[])
3. Fiddle or Project
usingSystem.Linq;usingSystem.Linq.Expressions;usingSystem.Linq.Dynamic.Core;usingLinqKit;usingMicrosoft.EntityFrameworkCore;vardb=newMyDb();Expression<Func<MyChildEntity,int>>reusableExpression= x =>x.Value;varallowedValues=newList<int>{7};varquery=db.MyChildEntities.AsExpandable().Where(x =>allowedValues.Contains(reusableExpression.Invoke(x))).Include(x =>x.Parent).Where("it.Id = 3");query.ToList();classMyDb:DbContext{publicDbSet<MyEntity>MyEntities{get;set;}publicDbSet<MyChildEntity>MyChildEntities{get;set;}protectedoverridevoidOnConfiguring(DbContextOptionsBuilderoptionsBuilder){optionsBuilder.UseInMemoryDatabase("test");}}classMyEntity{publicintId{get;set;}publicICollection<MyChildEntity>Children{get;set;}}classMyChildEntity{publicintId{get;set;}publicintParentId{get;set;}publicMyEntityParent{get;set;}publicintValue{get;set;}}
The issue happens when the .Include is between the Expandable query and the Dynamic query. This is an except from my application's complex query pipeline - reordering these statements would require some significant refactoring, so that workaround isn't really feasible for me at the moment.
The text was updated successfully, but these errors were encountered:
Here is what to include in your request to make sure we implement a solution as quickly as possible.
1. Description
When mixing EF Core, LinqKit's Expandable, and Linq Dynamic, Linq dynamic will infinitely recurse in
DefaultQueryAnalyzer.SupportsLinqToObjects
.2. Exception
If you are seeing an exception, include the full exception details (message and stack trace).
3. Fiddle or Project
4. Any further technical details
The issue happens when the .Include is between the Expandable query and the Dynamic query. This is an except from my application's complex query pipeline - reordering these statements would require some significant refactoring, so that workaround isn't really feasible for me at the moment.
The text was updated successfully, but these errors were encountered: