Click or drag to resize
AlgorithmsMinimumT Method (IEnumerableT, IComparerT)
Finds the minimum value in a collection. A supplied IComparer<T> is used to compare the items in the collection.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static T Minimum<T>(
	IEnumerable<T> collection,
	IComparer<T> comparer
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to search.
comparer
Type: System.Collections.GenericIComparerT
The comparer instance used to compare items in the collection.

Type Parameters

T
The type of items in the collection.

Return Value

Type: T
The smallest item in the collection.
Exceptions
ExceptionCondition
InvalidOperationExceptionThe collection is empty.
ArgumentNullExceptioncollection or comparer is null.
See Also