Ejemplo n.º 1
0
 public static IValidation ValidateLength(this IValidationProvider validator, Expression <Func <string> > property, int minLength, int maxLength)
 {
     return(validator.ValidateWith(property, val => val.Length >= minLength && val.Length <= maxLength, "{0} is the wrong length").TestNull(false));
 }
Ejemplo n.º 2
0
 public static IValidation ValidateNullRange(this IValidationProvider validator, Expression <Func <int?> > property, int min, int max)
 {
     return(validator.ValidateWith(property, val => val != null && val >= min && val <= max, "{0} must be between " + min + " and " + max));
 }
Ejemplo n.º 3
0
 public static IValidation ValidateNotNull(this IValidationProvider validator, Expression <Func <string> > property)
 {
     return(validator.ValidateWith(property, val => val != null, "{0} is null"));
 }