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
Somwhere between EF Core V6.0.5 and V7.0.4, a breaking change to the design time model generation has caused our model validation logic to fail, expecting there to be differences (using the HasDifferences/GetDifferences methods) between what's in the Database vs the design model.
This might be quite a niche problem due to our current model set up (see example below), but in EF Core 6.0.5 the integer field is marked as NonNullable, whereas upgrading to EF Core 7.0.4 and attempting to compare, the design time model shows the field as Nullable. We are making use of the SmartEnum package version 2.1.0 (this has not changed).
This looks to be by design. StatusRecord<TStatus>.Status is of a reference type and should be nullable by default. I couldn't find the commit in 7.0 that changed this behavior, but the expected workaround is to call t.Property(p => p.Status).IsRequired()
Related to #24685
File a bug
Somwhere between EF Core V6.0.5 and V7.0.4, a breaking change to the design time model generation has caused our model validation logic to fail, expecting there to be differences (using the
HasDifferences
/GetDifferences
methods) between what's in the Database vs the design model.This might be quite a niche problem due to our current model set up (see example below), but in EF Core 6.0.5 the integer field is marked as
NonNullable
, whereas upgrading to EF Core 7.0.4 and attempting to compare, the design time model shows the field asNullable
. We are making use of the SmartEnum package version 2.1.0 (this has not changed).Include your code
Include verbose output
EF Core 6.0.5 Design time Model DebugView:
EF Core 7.0.4 Design time Model DebugView:
Migration Operation when comparing in EF Core 7.0.4:
Include provider and version information
EF Core version: 6.0.5/7.0.4
Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (e.g. .NET 7.0)
Operating system: Windows 10
IDE: Rider 2022.3.1
The text was updated successfully, but these errors were encountered: