public virtual Premium GetPremium(Premium premium, InsuranceQuote insuranceQuote) { premium = ApplyRule(insuranceQuote, premium); if (!(_nextRule == null)) { premium = _nextRule.GetPremium(premium, insuranceQuote); } return(premium); }
public virtual Premium Handle(InsuranceQuote insuranceQuote) { if (!CanHandle(insuranceQuote)) { return(null); } var premium = new Premium(); premium = Rule.GetPremium(premium, insuranceQuote); return(premium); }