I have a model, EventSearch defined and I'm stumped on how to create a validator that will require at least one field to be filled for the model to be considered valid. It seems to me this will either be a model annotation or I could annotate each property as belonging to a group of "Require At Least One". Anybody run into this before?
Asked
Active
Viewed 1,407 times
1 Answers
1
Check out these links on how to create custom data annotations by extending from the ValidationAttribute class:
Custom model validation of dependent properties using Data Annotations

Community
- 1
- 1

Thomas Buckley
- 5,836
- 19
- 62
- 110