SQLite: Exception when using enum on entity #29521
Labels
area-sqlite
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
File a bug
When upgrading to efcore 7, the SQLite Database provider fails to save entities with enums. Instead, an Exception of type "System.InvalidOperationException" with a message like this is thrown:
The binary operator Equal is not defined for the types 'System.Int64' and 'Profession'.
.This is breaking one of my projects where I relied on int64 <-> Enum mapping for quite a few entities.
I have verified that the issue is not reproducible with Microsoft.EntityFrameworkCore.Sqlite version 6.0.10.
I have also verified that the issue is not present when using the InMemory Database provider (Microsoft.EntityFrameworkCore.InMemory, version 7.0.0).
Include your code
A full reproduction code can be found here:
https://github.com/StringEpsilon/efcore_regression/tree/main
I also have added branches that show that the issue does not exist on version 6.0.10 (https://github.com/StringEpsilon/efcore_regression/tree/efcore_6) and the InMemory provider (https://github.com/StringEpsilon/efcore_regression/tree/memory-db)
Minimal reproduction:
Include stack traces
Include version information
Microsoft.Data.Sqlite version:
7.0.0
Target framework:
net7.0
Operating system: Windows 10
The text was updated successfully, but these errors were encountered: