✅ About ModelState in MVC
Hello, I got stuck at a point about ModelState in my work. From a Create method, I Bind the Product model with "Name", "Price" and "Stock" and submit it with the form (only these values). Then I verify with ModelState.Isvalid, but because the "Id and UserId" fields in the Product model are null, it says invalid and returns "false". I don't want it to evaluate them because they won't come from the form (e.g. Id will automatically fill in the SQL Server). Can you help me how to proceed at this stage? (NOTE: I can make the UserId nullable and bypass it, but if I make the Id nullable I get the error "... when IDENTITY_INSERT is set to OFF".)



