예제 #1
0
 /// <summary>
 /// Register a rule
 /// </summary>
 /// <param name="validationRule"></param>
 public void AddValidationRule(IValidationRule <T> validationRule)
 {
     if (validationRule != null && validationRule.ValidationExpression != null)
     {
         ValidationRulesForExecutution.Add(validationRule);
     }
 }
예제 #2
0
        /// <summary>
        /// Register a validation rule
        /// </summary>
        /// <param name="validationRule"></param>
        public IValidationEngine <T> Register(IValidationRule <T> validationRule)
        {
            if (validationRule != null)
            {
                ValidationRulesForExecutution.Add(validationRule);
            }

            return(this);
        }
예제 #3
0
        /// <summary>
        /// Register a validation container before execution
        /// </summary>
        /// <param name="container"></param>
        public IValidationEngine <T> Register(IValidationRuleContainer <T> container)
        {
            if (container != null)
            {
                var _validationRules = container.GetValidationRules();
                if (_validationRules != null)
                {
                    ValidationRulesForExecutution.AddRange(_validationRules);
                }
            }

            return(this);
        }
 public RequestingUserValidationContainer()
 {
     ValidationRulesForExecutution.Add(new BaseDomainEntitySpecification <User>());
 }
예제 #5
0
 public NewUserValidationContainer(Func <bool> existingUserDelegate)
 {
     ValidationRulesForExecutution.Add(new NewUserMatchingSpecification());
     ValidationRulesForExecutution.Add(new EmailMatchingSpecification());
     ValidationRulesForExecutution.Add(new IsNotExistingUserSpecification(existingUserDelegate));
 }