From 0e12de83dc557b9ec540437656d14140f0d1e489 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Fri, 18 Oct 2019 12:46:13 +0200 Subject: [PATCH] Correct inheritance logic --- .../Query/Internal/NavigationExpandingExpressionVisitor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs b/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs index fdf4c4867fb..05bf3882a61 100644 --- a/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs +++ b/src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs @@ -179,8 +179,8 @@ private Expression ApplyQueryFilter(NavigationExpansionExpression navigationExpa // We need to do entity equality, but that requires a full method call on a query root to properly flow the // entity information through. Construct a MethodCall wrapper for the predicate with the proper query root. var filterWrapper = Expression.Call( - QueryableMethods.Where.MakeGenericMethod(sequenceType), - NullAsyncQueryProvider.Instance.CreateEntityQueryableExpression(sequenceType), + QueryableMethods.Where.MakeGenericMethod(rootEntityType.ClrType), + NullAsyncQueryProvider.Instance.CreateEntityQueryableExpression(rootEntityType.ClrType), filterPredicate); var rewrittenFilterWrapper = (MethodCallExpression)_entityEqualityRewritingExpressionVisitor.Rewrite(filterWrapper); filterPredicate = rewrittenFilterWrapper.Arguments[1].UnwrapLambdaFromQuote();