Since EFCore, the IsOptional-Method was removed from the FluentAPI. I've found this question here Required property but Nullable, Entity Framework through Code First, where using IsOptional was a solution for this issue.
What to do now? I'd like to use my EFCore models for both validation and storage but the rules do differ (e.g. Email is allowed to be null in the Database, but not for the validation).
I guess using <nullable>enable</nullable> should be used for this behavior so there is no need to check the [Required] attribute (or make it opt-out / -in at least).
Since EFCore, the
IsOptional-Method was removed from the FluentAPI. I've found this question here Required property but Nullable, Entity Framework through Code First, where using IsOptional was a solution for this issue.What to do now? I'd like to use my EFCore models for both validation and storage but the rules do differ (e.g. Email is allowed to be null in the Database, but not for the validation).
I guess using
<nullable>enable</nullable>should be used for this behavior so there is no need to check the[Required]attribute (or make it opt-out / -in at least).