/// <summary> /// Register a rule /// </summary> /// <param name="validationRule"></param> public void AddValidationRule(IValidationRule <T> validationRule) { if (validationRule != null && validationRule.ValidationExpression != null) { ValidationRulesForExecutution.Add(validationRule); } }
/// <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); }
/// <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>()); }
public NewUserValidationContainer(Func <bool> existingUserDelegate) { ValidationRulesForExecutution.Add(new NewUserMatchingSpecification()); ValidationRulesForExecutution.Add(new EmailMatchingSpecification()); ValidationRulesForExecutution.Add(new IsNotExistingUserSpecification(existingUserDelegate)); }