You need to perform this validation at model level, because it implies several properties at once. Check this link, for a similar issue : Make the email field required based on the dropdown list value selection
In your case, Validate
will test your boolean and Salaries
value, if false
and Salaries > 1000000
or Salaries < 1
, you'll return a new ValidationResult
containing your error message.