Just to throw a different solution into the mix, I'd recommend ditching the built-in model validation and giving FluentValidation a go.
https://fluentvalidation.codeplex.com/[
^]
It's much more flexible and you can use built-in rules, create your own custom rules and even set rules to be conditional.
From their website:
public class CustomerValidator: AbstractValidator<customer> {
public CustomerValidator() {
RuleFor(customer => customer.Surname).NotEmpty();
RuleFor(customer => customer.Forename).NotEmpty().WithMessage("Please specify a first name");
RuleFor(customer => customer.Discount).NotEqual(0).When(customer => customer.HasDiscount);
RuleFor(customer => customer.Address).Length(20, 250);
RuleFor(customer => customer.Postcode).Must(BeAValidPostcode).WithMessage("Please specify a valid postcode");
}
private bool BeAValidPostcode(string postcode) {
}
}
Customer customer = new Customer();
CustomerValidator validator = new CustomerValidator();
ValidationResult results = validator.Validate(customer);
bool validationSucceeded = results.IsValid;
IList<validationfailure> failures = results.Errors;</validationfailure></customer>