public decimal CalculateBasePriceFor(BasePremiumRuleList basePremiumRules, Cover cover, Calculation calculation) { return(basePremiumRules.Rules .Where(r => AppliesBasePremiumRuleCalculationParams(r, cover, calculation)) .Select(r => CalculateBasePrice(r, calculation)) .FirstOrDefault()); }
public BasePremiumRuleList AddBasePriceRule(BasePremiumRuleList basePremiumRules, string coverCode, string applyIfFormula, string basePriceFormula) { basePremiumRules.Rules.Add(new BasePremiumRule(coverCode, applyIfFormula, basePriceFormula)); return(basePremiumRules); }