Exemple #1
0
 public RequiredIfAttribute(string dependentProperty, Operator @operator, object dependentValue)
     : base(dependentProperty)
 {
     Operator       = @operator;
     DependentValue = dependentValue;
     Metadata       = OperatorMetadata.Get(Operator);
 }
Exemple #2
0
 public IsAttribute(Operator @operator, string dependentProperty)
     : base(dependentProperty)
 {
     Operator   = @operator;
     PassOnNull = false;
     _metadata  = OperatorMetadata.Get(Operator);
 }
Exemple #3
0
        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);
        }