Esempio n. 1
0
 public RequiredIfAttribute(string dependentProperty, Operator @operator, object dependentValue)
     : base(dependentProperty)
 {
     Operator       = @operator;
     DependentValue = dependentValue;
     Metadata       = OperatorMetadata.Get(Operator);
 }
Esempio n. 2
0
 public IsAttribute(Operator @operator, string dependentProperty)
     : base(dependentProperty)
 {
     Operator   = @operator;
     PassOnNull = false;
     _metadata  = OperatorMetadata.Get(Operator);
 }
Esempio n. 3
0
 public RequiredIfAttribute(string dependentProperty, Operator @operator, object dependentValue)
     : base(dependentProperty)
 {
     Operator = @operator;
     DependentValue = dependentValue;
     Metadata = OperatorMetadata.Get(Operator);
 }
Esempio n. 4
0
 public IsAttribute(Operator @operator, string dependentProperty)
     : base(dependentProperty)
 {
     Operator = @operator;
     PassOnNull = false;
     _metadata = OperatorMetadata.Get(Operator);
 }
        public override bool IsValid(object value, object dependentValue, object container)
        {
            if (Metadata.IsValid(dependentValue, DependentValue))
            {
                return(OperatorMetadata.Get(Operator.RegExMatch).IsValid(value, Pattern));
            }

            return(true);
        }