score:15

Accepted answer

To sum your inner dictionary just do:

DictSum = pt.Select(x => x.UnitsSoldByYear.Values.Sum()).Sum()

or equally:

DictSum = pt.Sum(x => x.UnitsSoldByYear.Values.Sum())

EDIT:

according to the OP comment, this creates a dictionary with the sum by each key:

DictSum = pt.SelectMany(kvp => kvp.UnitsSoldByYear)
            .GroupBy(kvp => kvp.Key)
            .ToDictionary(grp => grp.Key,grp => grp.Sum(kvp => kvp.Value))

Related Articles