public IValidationRulePredicated <TModel> Or( IValidationPredicate <TModel> predicate, params IValidationPredicate <TModel>[] predicates) { _predicateGroups .Add(predicate.And(predicates).ToArray()); return(this); }
public IValidationRulePredicated <TModel> Assert( IEnumerable <IValidationPredicate <TModel> > predicates) { var predicateGroups = new ValidationRulePredicateGroupsValidator <TModel>(); predicateGroups.Add(predicates.ToArray()); var builder = new ValidationRuleBuilder <TModel>(); var rule = new ValidationRulePredicated <TModel>(builder, predicateGroups); _validators.Add( new ValidationRuleConditionalValidator <TModel>( predicateGroups, true, true, builder) ); return(rule); }