You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EF Core 8 made the long awaited change and now scaffolds boolean columns with default value as bool instead of bool?. However, I found it doesn't work with Pomelo.EntityFrameworkCore.MySql provider. I believe that's because EF Core can't parse the default b'0' as false and b'1' as true.
Currently, as a workaround, I register a custom IDatabaseModelFactory in IDesignTimeServices with this code to make it work:
The text was updated successfully, but these errors were encountered:
gao-artur
changed the title
EF Core 8 scaffolds bool columns with default value as nullable
EF Core 8 scaffolds BIT(1) columns with default value as nullable bool
Jul 12, 2024
The issue
EF Core 8 made the long awaited change and now scaffolds boolean columns with default value as
bool
instead ofbool?
. However, I found it doesn't work withPomelo.EntityFrameworkCore.MySql
provider. I believe that's because EF Core can't parse the defaultb'0'
asfalse
andb'1'
astrue
.Currently, as a workaround, I register a custom
IDatabaseModelFactory
inIDesignTimeServices
with this code to make it work:Further technical details
MySQL version: 8.0.28
Operating system: Win10
Pomelo.EntityFrameworkCore.MySql version: 8.0.2
Microsoft.AspNetCore.App version: 8.0.7
Other details about my project setup:
The text was updated successfully, but these errors were encountered: