I have a model where the property CompanyID allows a null value
public partial class ReportTemplateItem
{
[Key]
public int ReportTemplateItemID { get; set; }
[Required]
public int ReportTemplateID { get; set; }
public int? CompanyID { get; set; }
}
In the DBContext OnModelCreating, there is no property declared for CompanyID
But when posting the ModelState is Invalid. The form works as intended if I remove ModelState validation
Accepting a null value appears to be the default behavior for Model Validation, what am i missing?
Razor Pages with EF Core 3.0, Nullable Reference Types is disabled
many thanks