1var numbers = new[] { 1, 2, 3, 4, 5 };
2
3// Count all elements
4int total = numbers.Count(); // 5
5
6// Count with condition
7int evens = numbers.Count(n => n % 2 == 0); // 2
8
9// LongCount for large collections
10long bigCount = hugeCollection.LongCount();