LINQ "Contains" fails to generate SQL with custom converter #32376
Labels
area-type-mapping
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
Servicing-approved
type-bug
Milestone
After upgrading to EF Core 8, my custom converter for
Enum
no longer work. For readability in the database, we have decided to usenvarchar(1)
fields to represent enum values. It's up to the developer to define some sort ofchar
per enum field, for exampleThis was working fine with EF Core 6 and EF7, using a custom converter:
Stacktrace
With the new
Contains
LINQ conversion andOPENJSON
syntax however, EF8 fails to generate SQL and instead crashes with the following exception:This can be worked around by falling back to
options.UseCompatibilityLevel(120);
and not usingOPENJSON
.Include your code
Include verbose output
Include provider and version information
EF Core version: 8.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 8.0
Operating system: Win10
IDE: Visual Studio 2022 17.8
The text was updated successfully, but these errors were encountered: