I have 2 foreign key fields in a table, after updating to VS2022 my model can not post unless I do option 1 or 2.
- Allow the 2 foreign table fields in the many table to be null with the question mark as below:
public virtual DGroup? DGroup { get; set; }
public virtual ApplicationUser? ApplicationUser { get; set; }
- In the .csproj switch
<Nullable>enable</Nullable>to<Nullable>disable</Nullable>
The 2 virtuals show up in ModelState, if I mark them null doesn't it affect my referential integrity? I want the database to cascade delete my 'many resolution' table on delete of my master table.