I am using Rulesets on a type that looks like this:
public class Salary
{
public decimal HourlyRate { get; set; }
[ValidHours] //Custom validator
public int NumHours { get; set; }
[VerifyValidState(Ruleset="State")] //Custom validator with ruleset
public string State { get; set; }
}
Due to business requirements, I'd need to first validate the ruleset "State" and then validate the entire business entity
public void Save()
{
ValidationResults results = Validation.Validate(salary, "State");
//Check for validity
//Now run the validation for ALL rules including State ruleset
ValidationResults results2 = Validation.Validate(salary); //Does not run the ruleset marked with "State"
}
How do I accomplish what I am trying to do?