List.Contains does not work with List<object> #20624
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Hello,
i'd like to create a query which filters by a
List<object>
in EFCore 3.1.3. This was working before in EFCore 2.2.6.Steps to reproduce
Filtering by a
List<object>
throws an InvalidOperationException.System.InvalidOperationException: Null TypeMapping in Sql Tree
Stack Trace:
SqlTypeMappingVerifyingExpressionVisitor.VisitExtension(Expression node)
Expression.Accept(ExpressionVisitor visitor)
ExpressionVisitor.Visit(Expression node)
InExpression.VisitChildren(ExpressionVisitor visitor)
ExpressionVisitor.VisitExtension(Expression node)
SqlTypeMappingVerifyingExpressionVisitor.VisitExtension(Expression node)
Expression.Accept(ExpressionVisitor visitor)
ExpressionVisitor.Visit(Expression node)
RelationalSqlTranslatingExpressionVisitor.Translate(Expression expression)
RelationalQueryableMethodTranslatingExpressionVisitor.TranslateExpression(Expression expression)
RelationalQueryableMethodTranslatingExpressionVisitor.TranslateLambdaExpression(ShapedQueryExpression shapedQueryExpression, LambdaExpression lambdaExpression)
RelationalQueryableMethodTranslatingExpressionVisitor.TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate)
QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
MethodCallExpression.Accept(ExpressionVisitor visitor)
ExpressionVisitor.Visit(Expression node)
QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
Database.CompileQuery[TResult](Expression query, Boolean async)
QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
<>c__DisplayClass12_0
1.<ExecuteAsync>b__0() CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func
1 compiler)CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func
1 compiler) QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken) EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken) EntityQueryable
1.GetAsyncEnumerator(CancellationToken cancellationToken)ConfiguredCancelableAsyncEnumerable
1.GetAsyncEnumerator() EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable
1 source, CancellationToken cancellationToken)When i change the List type to
Guid
it works.As this is only a simplified sample code changing the List type is not a prefereable option.
Further technical details
EF Core version: 3.1.3
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: netcoreapp3.1
Operating system: Windows 10
IDE: Visual Studio 2019 16.4
The text was updated successfully, but these errors were encountered: