Пример #1
0
 public static ObjectValidationBuilder IsNotIn(ObjectValidationBuilder target, string property, IEnumerable items, string message)
 {
     return(target.Predicate(new NotValidator {
         Property = property, Operator = new InValidator {
             Items = items
         }, Message = message
     }));
 }
Пример #2
0
 public static ObjectValidationBuilder IsNotRegex(ObjectValidationBuilder target, string property, string pattern, string message)
 {
     return(target.Predicate(new NotValidator {
         Property = property, Operator = new RegexValidator {
             Pattern = pattern
         }, Message = message
     }));
 }
Пример #3
0
 public static ObjectValidationBuilder IsNotContains(ObjectValidationBuilder target, string property, string value, string message)
 {
     return(target.Predicate(new NotValidator {
         Property = property, Operator = new ContainsValidator {
             Value = value
         }, Message = message
     }));
 }
Пример #4
0
 public static ObjectValidationBuilder IsNotEndsWith(ObjectValidationBuilder target, string value, string message)
 {
     return(target.Predicate(new NotValidator {
         Operator = new EndsWithValidator {
             Value = value
         }, Message = message
     }));
 }
Пример #5
0
        // IsUri

        public static ObjectValidationBuilder IsUri(ObjectValidationBuilder target, string message)
        {
            return(target.Predicate(new UriValidator {
                Message = message
            }));
        }
Пример #6
0
 public static ObjectValidationBuilder IsNotRelativeUri(ObjectValidationBuilder target, string message)
 {
     return(target.Predicate(new NotValidator {
         Operator = new RelativeUriValidator(), Message = message
     }));
 }
Пример #7
0
        // IsRegex

        public static ObjectValidationBuilder IsRegex(ObjectValidationBuilder target, string pattern, string message)
        {
            return(target.Predicate(new RegexValidator {
                Pattern = pattern, Message = message
            }));
        }
Пример #8
0
        // IsContains

        public static ObjectValidationBuilder IsContains(ObjectValidationBuilder target, string value, string message)
        {
            return(target.Predicate(new ContainsValidator {
                Value = value, Message = message
            }));
        }
Пример #9
0
        // IsEqual

        public static ObjectValidationBuilder IsEqual(ObjectValidationBuilder target, object value, string message)
        {
            return(target.Predicate(new EqualValidator {
                Value = value, Message = message
            }));
        }
Пример #10
0
 public static ObjectValidationBuilder IsEndsWith(ObjectValidationBuilder target, string property, string value, string message)
 {
     return(target.Predicate(new EndsWithValidator {
         Property = property, Value = value, Message = message
     }));
 }
Пример #11
0
        // IsStartsWith

        public static ObjectValidationBuilder IsStartsWith(ObjectValidationBuilder target, string value, string message)
        {
            return(target.Predicate(new StartsWithValidator {
                Value = value, Message = message
            }));
        }
Пример #12
0
 public static ObjectValidationBuilder IsNotNullOrWhiteSpace(ObjectValidationBuilder target, string message)
 {
     return(target.Predicate(new NotValidator {
         Operator = new NullOrWhiteSpaceValidator(), Message = message
     }));
 }
Пример #13
0
        // IsNullOrEmpty

        public static ObjectValidationBuilder IsNullOrEmpty(ObjectValidationBuilder target, string message)
        {
            return(target.Predicate(new NullOrEmptyValidator {
                Message = message
            }));
        }
Пример #14
0
        // IsIn

        public static ObjectValidationBuilder IsIn(ObjectValidationBuilder target, IEnumerable items, string message)
        {
            return(target.Predicate(new InValidator {
                Items = items, Message = message
            }));
        }
Пример #15
0
 public static ObjectValidationBuilder IsNotUri(ObjectValidationBuilder target, string property, string message)
 {
     return(target.Predicate(new NotValidator {
         Property = property, Operator = new UriValidator(), Message = message
     }));
 }
Пример #16
0
 public static ObjectValidationBuilder IsNull(ObjectValidationBuilder target, string property, string message)
 {
     return(target.Predicate(new NullValidator {
         Property = property, Message = message
     }));
 }
Пример #17
0
 public static ObjectValidationBuilder IsNotDefault(ObjectValidationBuilder target, string message)
 {
     return(target.Predicate(new NotValidator {
         Operator = new DefaultValueValidator(), Message = message
     }));
 }