> foreach
decimal technicalPremium = 0; foreach (Risk risk in risks) { technicalPremium = technicalPremium + risk.TechnicalPremium; } return technicalPremium;
> linq
return risks.Sum(risk => risk.TechnicalPremium);