Exemple #1
0
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return new Required
     {
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     };
 }
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return(new NotNull
     {
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     });
 }
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return(new GreaterThan
     {
         Value = ((GreaterThanValidator)propertyValidator).ValueToCompare,
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     });
 }
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return new GreaterThanOrEqual
     {
         Value = ((GreaterThanOrEqualValidator)propertyValidator).ValueToCompare,
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     };
 }
Exemple #5
0
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     var emailRule = new Email
     {
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     };
     return emailRule;
 }
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return(new LessThanOrEqual
     {
         Value = ((LessThanOrEqualValidator)propertyValidator).ValueToCompare,
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     });
 }
Exemple #7
0
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return new LessThan
     {
         Value = ((LessThanValidator)propertyValidator).ValueToCompare,
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     };
 }
Exemple #8
0
        public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
        {
            var emailRule = new Email
            {
                Message = propertyValidator.GetErrorMessageFor(propertyName)
            };

            return(emailRule);
        }
Exemple #9
0
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return(new Length
     {
         Min = ((ILengthValidator)propertyValidator).Min,
         Max = ((ILengthValidator)propertyValidator).Max,
         Message = propertyValidator.GetErrorMessageFor(propertyName)
     });
 }
Exemple #10
0
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     return new Length
         {
             Min = ((ILengthValidator)propertyValidator).Min,
             Max = ((ILengthValidator)propertyValidator).Max,
             Message = propertyValidator.GetErrorMessageFor(propertyName)
         };
 }
Exemple #11
0
 public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
 {
     var rule = new Regex
     {
         Message = propertyValidator.GetErrorMessageFor(propertyName),
         Expression = ((IRegularExpressionValidator)propertyValidator).Expression
     };
     return rule;
 }
Exemple #12
0
        public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
        {
            var rule = new Regex
            {
                Message    = propertyValidator.GetErrorMessageFor(propertyName),
                Expression = ((IRegularExpressionValidator)propertyValidator).Expression
            };

            return(rule);
        }