EnumerableUtility.CountIsExactly<T> method

Returns true if the count is as specified.

public static bool CountIsExactly<T>(this IEnumerable<T> source, int count)
parameter description
T The type of the element.
source The sequence.
count The count.

Return Value

True if the count is as specified.

Remarks

This method will often be faster than calling Enumerable.Count() and testing that value when the count may be much larger than the count being tested.

See Also