dotnettips.wordpress.com
Optimizing IEnumerable Counting in Microsoft.NET: The Fastest Approach Revealed
To count elements in an IEnumerable collection, developers typically use the Count() method from System.Linq. Enumerable, with alternatives like TryGetNonEnumeratedCount() and LongCount() also available.