10 minpresentation

Aggregation and Element Operations

Aggregation and Element Operations

0 / 13 completed

Count

csharp
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();
Step 1 of 13
← → NavigateSpace: Skip / NextEnter: Next