To Exclude a Required Field from ModelState Validation, Even When It's Required in the Database , you should follow the below steps in details:
ModelState
It's necessary to remove the property from the model :
ModelState.Remove("PropertyName")
It's advisable to assign a default value to this property , In the example below, I use an empty string "" for string property
model.ProperityName = ""
1.1k questions
674 answers
454 comments
193k users
Related Activities
Categories
Most popular tags