public static ValidationResults Validate <T>(T target, params string[] rulesets) { if (rulesets == null) { throw new ArgumentNullException("rulesets"); } ValidationResults results = new ValidationResults(); foreach (string str in rulesets) { foreach (ValidationResult result in (IEnumerable <ValidationResult>)ValidationFactory.CreateValidator <T>(str).Validate(target)) { results.AddResult(result); } } return(results); }
public static ValidationResults Validate <T>(T target, params string[] rulesets) { if (rulesets == null) { throw new ArgumentNullException("rulesets"); } ValidationResults validationResults = new ValidationResults(); foreach (string ruleset in rulesets) { Validator <T> validator = ValidationFactory.CreateValidator <T>(ruleset); foreach (ValidationResult item in (IEnumerable <ValidationResult>)validator.Validate(target)) { validationResults.AddResult(item); } } return(validationResults); }
public static ValidationResults Validate <T>(T target, params string[] rulesets) { if (rulesets == null) { throw new ArgumentNullException("rulesets"); } ValidationResults validationResults = new ValidationResults(); for (int i = 0; i < rulesets.Length; i++) { string ruleset = rulesets[i]; Validator <T> validator = ValidationFactory.CreateValidator <T>(ruleset); foreach (ValidationResult current in ((IEnumerable <ValidationResult>)validator.Validate(target))) { validationResults.AddResult(current); } } return(validationResults); }
public static Validator CreateValidator(Type targetType) { return(ValidationFactory.CreateValidator(targetType, string.Empty)); }
public static Validator <T> CreateValidator <T>(string ruleset) { return(ValidationFactory.CreateValidator <T>(ruleset, true)); }
public static Validator <T> CreateValidator <T>() { return(ValidationFactory.CreateValidator <T>(string.Empty, true)); }
public static Validator CreateValidator(Type targetType, string ruleset) { return(ValidationFactory.CreateValidator(targetType, ruleset, true)); }
public static ValidationResults Validate <T>(T target) { Validator <T> validator = ValidationFactory.CreateValidator <T>(); return(validator.Validate(target)); }
public static ValidationResults Validate <T>(T target) { return(ValidationFactory.CreateValidator <T>().Validate(target)); }