/// <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(); }
/// <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; }