Пример #1
0
 /// <summary>
 /// Checks the business rule and throws a BusinessRuleViolationException if it is not satified
 /// </summary>
 /// <exception cref="BusinessRuleViolationException">if the rule is not satified</exception>
 public static void ThrowIfNotSatisfied(BusinessRule rule)
 {
     rule.ThrowIfNotSatisfied();
 }
Пример #2
0
 /// <summary>
 /// Combines this rule with another rule. Both rules must be satified to satisfy the combined rule.
 /// </summary>
 /// <param name="rule">another rule</param>
 /// <returns>a combined rule</returns>
 public BusinessRule And(BusinessRule rule)
 {
     return(new AndBusinessRule(this, rule));
 }
 public AndBusinessRule(BusinessRule firstRule, BusinessRule secondRule)
 {
     _firstRule = firstRule;
     _secondRule = secondRule;
 }