Closed steffibreuer closed 4 years ago
Hello, i encountered the exact same error, in the same context with EF Core 8.0.6.
I made a small repo for reproduction here
We found a workaround to type the list we were using with reflection, but i thought I'll let you know.
@LouLeGrain I filed #33928 to track this.
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, Func1 compiler) QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken) EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken) EntityQueryable
1.GetAsyncEnumerator(CancellationToken cancellationToken) ConfiguredCancelableAsyncEnumerable1.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