C# List of objects, how do I get the sum of a property
using System.Linq;
...
double total = myList.Sum(item => item.Amount);
And if you need to do it on items that match a specific condition...
double total = myList.Where(item => item.Name == "Eggs").Sum(item => item.Amount);
Another alternative:
myPlanetsList.Select(i => i.Moons).Sum();