private static int Sum(int[] items) { var sum = 0; foreach (var item in items.Cast<int>()) { sum += item; } return sum; } }