Gringotts.Domain.Holding.CalculateParticipation C# (CSharp) Method

CalculateParticipation() private method

private CalculateParticipation ( ) : Amount>.Dictionary
return Amount>.Dictionary
        private Dictionary<Investment, Amount> CalculateParticipation()
        {
            Amount totalInvestment = investments.Aggregate(new Amount(0), (total, investment) => total + investment.Value);
            Dictionary<Investment, Amount> participation = new Dictionary<Investment, Amount>();
            Investments.ForEach(investment => participation.Add(investment, totalInvestment/investment.Value));

            return participation;
        }