Esempio n. 1
0
 public static FluentValidation.IRuleBuilderOptions <T, TProperty> StringMatches <T, TProperty>(this FluentValidation.IRuleBuilder <T, TProperty> ruleBuilder, string expression)
 {
     if (typeof(TProperty) == typeof(string))
     {
         return(ruleBuilder.SetValidator(new RegularExpressionValidator(expression)));
     }
     return(ruleBuilder.SetValidator(new ObjectRegularExpressionValidator(expression)));
 }
Esempio n. 2
0
 public static FluentValidation.IRuleBuilderOptions <T, TProperty> StringContainsWhiteSpace <T, TProperty>(this FluentValidation.IRuleBuilder <T, TProperty> ruleBuilder)
 {
     return(ruleBuilder.SetValidator(new StringContainsWhiteSpaceValidator()));
 }
 public static FluentValidation.IRuleBuilderOptions <T, EmailAddress> EmailAddress <T>(this FluentValidation.IRuleBuilder <T, EmailAddress> ruleBuilder)
 {
     return(ruleBuilder.SetValidator(new EmailAddress.Validator()));
 }