Add repro tests for SqlServerStringTypeMapping collection type mapping#45
Open
angularsen wants to merge 2 commits intoStevenRasmussen:masterfrom
Open
Add repro tests for SqlServerStringTypeMapping collection type mapping#45angularsen wants to merge 2 commits intoStevenRasmussen:masterfrom
angularsen wants to merge 2 commits intoStevenRasmussen:masterfrom
Conversation
System.Diagnostics.UnreachableException: A SqlServerStringTypeMapping collection type mapping could not be found ``` System.Diagnostics.UnreachableException A SqlServerStringTypeMapping collection type mapping could not be found at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerTypeMappingPostprocessor.ApplyTypeMappingsOnOpenJsonExpression(SqlServerOpenJsonExpression openJsonExpression, IReadOnlyList`1 typeMappings) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression.<VisitChildren>g__VisitList|117_0[T](List`1 list, Boolean inPlace, Boolean& changed, <>c__DisplayClass117_0&) at Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression.VisitChildren(ExpressionVisitor visitor) at Microsoft.EntityFrameworkCore.Query.RelationalTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.Query.SqlExpressions.InExpression.VisitChildren(ExpressionVisitor visitor) at Microsoft.EntityFrameworkCore.Query.RelationalTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression.VisitChildren(ExpressionVisitor visitor) at Microsoft.EntityFrameworkCore.Query.RelationalTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.Query.RelationalTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerTypeMappingPostprocessor.VisitExtension(Expression expression) at Microsoft.EntityFrameworkCore.Query.RelationalTypeMappingPostprocessor.Process(Expression expression) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerQueryTranslationPostprocessor.ProcessTypeMappings(Expression expression) at Microsoft.EntityFrameworkCore.Query.RelationalQueryTranslationPostprocessor.Process(Expression query) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerQueryTranslationPostprocessor.Process(Expression query) at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutorExpression[TResult](Expression query) at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query) at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass11_0`1.<ExecuteCore>b__0() at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken) at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of upgrading to .NET9 and EF Core 9, I stumbled on a breaking change in one of my queries.
EF Core 9 fails on
SqlServerStringTypeMappingwhen passing NodaTimeLocalDatevalues as an SQL parameter to.Contains(), either implicitly or explicity withEF.Parameter().Error: System.Diagnostics.UnreachableException: A SqlServerStringTypeMapping collection type mapping could not be found
Test cases added to illustrate the problem:
Db.Race.Where(r => EF.Constant(dates).Contains(r.Date))Db.Race.Where(r => EF.Parameter(dates).Contains(r.Date))Although there is a trivial workaround, do you know if it is possible for this library to handle this case without having to explicitly declare
Ef.Constant()?