/// <summary> /// Returns a validator representing the validation criteria specified for type <typeparamref name="T"/> /// through attributes on type <typeparamref name="T"/> and its ancestors for the supplied ruleset. /// </summary> /// <typeparam name="T">The type to get the validator for.</typeparam> /// <param name="ruleset">The name of the required ruleset.</param> /// <returns>The validator.</returns> /// <exception cref="ArgumentNullException">when the <paramref name="ruleset"/> is <see langword="null"/>.</exception> public static Validator <T> CreateValidatorFromAttributes <T>(string ruleset) { return(DefaultAttributeValidatorFactory.CreateValidator <T>(ruleset)); }
/// <summary> /// Returns a validator representing the validation criteria specified for type <paramref name="targetType"/> /// through attributes on type <paramref name="targetType"/> and its ancestors for the supplied ruleset. /// </summary> /// <param name="targetType">The type to get the validator for.</param> /// <param name="ruleset">The name of the required ruleset.</param> /// <returns>The validator.</returns> /// <exception cref="ArgumentNullException">when the <paramref name="ruleset"/> is <see langword="null"/>.</exception> public static Validator CreateValidatorFromAttributes(Type targetType, string ruleset) { return(DefaultAttributeValidatorFactory.CreateValidator(targetType, ruleset)); }
/// <summary> /// Returns a validator representing the validation criteria specified for type <typeparamref name="T"/> /// through attributes on type <typeparamref name="T"/> and its ancestors for the default ruleset. /// </summary> /// <typeparam name="T">The type to get the validator for.</typeparam> /// <returns>The validator.</returns> public static Validator <T> CreateValidatorFromAttributes <T>() { return(DefaultAttributeValidatorFactory.CreateValidator <T>()); }