How to ignor validation errors of all properties of specific class in ModelState

55 views Asked by At

I need to ignor validation errors of all properties of specific class in ModelState. For instance I have view model which contents the Customer class and Customer contents Address class. I need to ignore all validation errors of Address properties.

1

There are 1 answers

2
Łukasz Zwierko On

ModelState.Errors.Clear() ? this'll clear the errors, you can always copy them into another collection for reuse.