using System; using System.Collections.Generic; using System.Linq; var vals = new List<int>() { 1, 2, 3, 4, 5, 6, 7 }; int sum = vals.Sum(); Console.WriteLine(sum);