Repository navigation
Description
[ConditionalFact]
public virtual void Include_before_Concat()
{
using(var context = CreateContext())
{
context.Customers.Include(c => c.Orders).Concat(context.Customers).ToList();
}
}System.ArgumentException : The input sequence must have items of type 'Microsoft.EntityFrameworkCore.TestModels.Northwind.Customer', but it has items of type 'Microsoft.EntityFrameworkCore.Query.Internal.AnonymousObject'.
Parameter name: inputInfo
at Remotion.Linq.Clauses.ResultOperatorBase.CheckSequenceItemType(StreamedSequenceInfo inputInfo, Type expectedItemType)
at Remotion.Linq.Clauses.ResultOperators.ConcatResultOperator.GetOutputDataInfo(IStreamedDataInfo inputInfo)
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable1 source, TAccumulate seed, Func3 func)
at Remotion.Linq.QueryModel.GetOutputDataInfo()
at Remotion.Linq.Clauses.Expressions.SubQueryExpression..ctor(QueryModel queryModel)
at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.CreateJoinToParentQuery(QueryModel parentQueryModel, QuerySourceReferenceExpression parentQuerySourceReferenceExpression, Expression outerTargetExpression, IForeignKey foreignKey, QueryModel targetQueryModel, ICollection1 subQueryProjection) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.cs:line 394 at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.Rewrite(QueryModel collectionQueryModel, INavigation navigation) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.cs:line 149 at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.cs:line 65 at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Dynamic.Utils.ExpressionVisitorUtils.VisitBlockExpressions(ExpressionVisitor visitor, BlockExpression block) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitLambda[T](Expression1 node)
at System.Linq.Expressions.Expression1.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor visitor, IArgumentProvider nodes) at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node) at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\IncludeCompiler.CollectionQueryModelRewritingExpressionVisitor.cs:line 83 at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Remotion.Linq.Clauses.SelectClause.TransformExpressions(Func2 transformation)
at Remotion.Linq.QueryModel.TransformExpressions(Func2 transformation) at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.RewriteCollectionQueries(QueryModel queryModel) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\IncludeCompiler.cs:line 114 at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.RewriteCollectionQueries() in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\IncludeCompiler.cs:line 101 at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.OptimizeQueryModel(QueryModel queryModel, Boolean asyncQuery) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\EntityQueryModelVisitor.cs:line 349 at Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor.OptimizeQueryModel(QueryModel queryModel, Boolean asyncQuery) in C:\enlistments\Universe\EntityFramework\src\EFCore.Relational\Query\RelationalQueryModelVisitor.cs:line 1345 at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateQueryExecutor[TResult](QueryModel queryModel) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\EntityQueryModelVisitor.cs:line 170 at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](QueryModel queryModel) in C:\enlistments\Universe\EntityFramework\src\EFCore\Storage\Database.cs:line 70 --- End of stack trace from previous location where exception was thrown --- at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](Expression query, IQueryModelGenerator queryModelGenerator, IDatabase database, IDiagnosticsLogger1 logger, Type contextType) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\QueryCompiler.cs:line 151
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass13_01.<Execute>b__0() in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\QueryCompiler.cs:line 91 at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func1 compiler) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\CompiledQueryCache.cs:line 67
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func1 compiler) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\CompiledQueryCache.cs:line 44 at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\QueryCompiler.cs:line 87 at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression) in C:\enlistments\Universe\EntityFramework\src\EFCore\Query\Internal\EntityQueryProvider.cs:line 62 at Remotion.Linq.QueryableBase1.GetEnumerator()
at System.Collections.Generic.List1.AddEnumerable(IEnumerable1 enumerable)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.EntityFrameworkCore.Query.SimpleQuerySqlServerTest.Include_before_Concat() in C:\enlistments\Universe\EntityFramework\test\EFCore.SqlServer.FunctionalTests\Query\SimpleQuerySqlServerTest.JoinGroupJoin.cs:line 555
Activity
maumar commentedon Jun 20, 2019
assigning to @roji since he is implementing set operations
Set operations: finalization
Set operations: finalization
roji commentedon Jun 25, 2019
This actually works in the new implementation (#16249) - even with an include only on one operand of the set operation.
Set operations: finalization
Set operations: finalization
Set operations: finalization
Set operations: finalization
6 remaining items
Include/nav support for set operations
Include/nav support for set operations