コード例 #1
0
 /// <summary>
 /// Returns a validator representing the validation criteria specified for type <paramref name="targetType"/>
 /// through configuration and aatributes on type <paramref name="targetType"/> and its ancestors for the default ruleset.
 /// </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));
 }
コード例 #2
0
 /// <summary>
 /// Returns a validator representing the validation criteria specified for type <typeparamref name="T"/>
 /// through configuration and 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> CreateValidator <T>(string ruleset)
 {
     return(DefaultCompositeValidatorFactory.CreateValidator <T>(ruleset));
 }
コード例 #3
0
 /// <summary>
 /// Resets the cached validators.
 /// </summary>
 public static void ResetCaches()
 {
     DefaultCompositeValidatorFactory.ResetCache();
 }
コード例 #4
0
 /// <summary>
 /// Returns a validator representing the validation criteria specified for type <typeparamref name="T"/>
 /// through configuration and 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> CreateValidator <T>()
 {
     return(DefaultCompositeValidatorFactory.CreateValidator <T>());
 }
コード例 #5
0
 /// <summary>
 /// Returns a validator representing the validation criteria specified for type <paramref name="targetType"/>
 /// through configuration and 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 CreateValidator(Type targetType, string ruleset)
 {
     return(DefaultCompositeValidatorFactory.CreateValidator(targetType, ruleset));
 }