Validation failed for one or more entities in Entity Framework for nullable boolean property

c# entity-framework-6 sql sql-server-2008

Accepted Answer

The problem was that a boolean value could not be set to be null. EF will always see it as necessary. I modifiedIsModified bit null to IsModified bit not null default 1 . and made use of migration to update the existing entries with default values. https://docs.microsoft.com/en-us/ef/core/modeling/required-optional is the reference.

1
8/8/2018 9:46:33 PM

Popular Answer

ZZZ_tmp


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow