Click or drag to resize
AlgorithmsCountT Method
Count the number of items in an IEnumerable<T> collection. If a more specific collection type is being used, it is more efficient to use the Count property, if one is provided.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static int Count<T>(
	IEnumerable<T> collection
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to count items in.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.Count``1(System.Collections.Generic.IEnumerable{``0})"]

Return Value

Type: Int32
The number of items in the collection.
Exceptions
ExceptionCondition
ArgumentNullExceptioncollection is null.
Remarks
If the collection implements ICollection<T>, this method simply returns ICollection<T>.Count. Otherwise, it enumerates all items and counts them.
See Also