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);
 }
        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);
        }