Ejemplo n.º 1
0
 /// <summary>
 /// Returns a validator that represents the validation criteria specified for type <paramref name="targetType"/>
 /// through configuration and attributes on type <paramref name="targetType"/> and its ancestors for the supplied rule set.
 /// </summary>
 /// <param name="targetType">The type to get the validator for.</param>
 /// <param name="ruleset">The name of the required rule set.</param>
 /// <returns>The validator.</returns>
 /// <exception cref="ArgumentNullException">The <paramref name="ruleset"/> is <see langword="null"/>.</exception>
 public static Validator CreateValidator(Type targetType, string ruleset)
 {
     return(DefaultCompositeValidatorFactory.CreateValidator(targetType, ruleset));
 }
 /// <summary>
 /// Returns a validator that represents the validation criteria specified for type <typeparamref name="T"/>
 /// through configuration and attributes on type <typeparamref name="T"/> and its ancestors for the supplied rule set.
 /// </summary>
 /// <typeparam name="T">The type to get the validator for.</typeparam>
 /// <param name="ruleset">The name of the required rule set.</param>
 /// <returns>The validator.</returns>
 /// <exception cref="ArgumentNullException">The <paramref name="ruleset"/> is <see langword="null"/>.</exception>
 public static Validator <T> CreateValidator <T>(string ruleset)
 {
     return(DefaultCompositeValidatorFactory.CreateValidator <T>(ruleset));
 }
 /// <summary>
 /// Returns a validator that represents the validation criteria specified for type <paramref name="targetType"/>
 /// through configuration and attributes on type <paramref name="targetType"/> and its ancestors for the default rule set.
 /// </summary>
 /// <param name="targetType">The type to get the validator for.</param>
 /// <returns>The validator.</returns>
 public static Validator CreateValidator(Type targetType)
 {
     return(DefaultCompositeValidatorFactory.CreateValidator(targetType));
 }
 /// <summary>
 /// Returns a validator that represents the validation criteria specified for type <typeparamref name="T"/>
 /// through configuration and attributes on type <typeparamref name="T"/> and its ancestors for the default rule set.
 /// </summary>
 /// <typeparam name="T">The type to get the validator for.</typeparam>
 /// <returns>The validator.</returns>
 public static Validator <T> CreateValidator <T>()
 {
     return(DefaultCompositeValidatorFactory.CreateValidator <T>());
 }