Query: orderby + include + complex projection doesn't work #5612
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
copied from one of the comments in #4637
model:
query:
Exception:
The given expression 'new <>f__AnonymousType12(Id = [x].Id, Country = new <>f__AnonymousType22(Code = Property([x], "CountryCode"), Name = [x.Country].Name))' does not contain the searched expression '[x]' in a nested NewExpression with member assignments or a MemberBindingExpression.
Parameter name: fullExpression
at Remotion.Linq.Clauses.ExpressionVisitors.AccessorFindingExpressionVisitor.FindAccessorLambda(Expression searchedExpression, Expression fullExpression, ParameterExpression inputParameter)
at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.IncludeNavigations(QueryModel queryModel, IReadOnlyCollection1 includeSpecifications) at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateAsyncQueryExecutor[TResult](QueryModel queryModel) at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddAsyncQuery[TResult](Object cacheKey, Func1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsyncTResult
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.System.Collections.Generic.IAsyncEnumerable.GetEnumerator() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.d__1291.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
The error can be removed in a few ways like:
The text was updated successfully, but these errors were encountered: