Exemplo n.º 1
0
        private bool anySubRulesBrokenForCriteria(Func <IBusinessRule, bool> specification)
        {
            var businessRuleSet = new BusinessRuleSet(_underlyingRules.Where(specification));

            Description = businessRuleSet.Message;
            return(businessRuleSet.IsEmpty);
        }
Exemplo n.º 2
0
        private bool anySubRulesBrokenForCriteria(Func <IBusinessRule, bool> specification)
        {
            var rulesToValidates = _propertyNameToValidate == null
            ? _underlyingRules
            : _underlyingRules.Where(rule => rule.IsRuleFor(_propertyNameToValidate));

            var brokenRules = new BusinessRuleSet(rulesToValidates.Where(specification));

            Description             = brokenRules.Message;
            _propertyNameToValidate = null;
            return(brokenRules.IsEmpty);
        }