I have a list of objects like this:
List list = new List(); list.Add(new ClassName() { Name = 1, Amount = 5 }); list.Ad
var lst = list.GroupBy(g = > g.Name).Select(t = > new ClassName() { Amount = t.Sum(s=>s.Amount), Name = t.Key }).ToList();