Click or drag to resize

ExtensionsMinByTSource, TKey Method (IEnumerableTSource, FuncTSource, TKey, IComparerTKey)

Returns the item with the minimum value in a sequence of values.

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.2
Syntax
public static TSource MinBy<TSource, TKey>(
	this IEnumerable<TSource> source,
	Func<TSource, TKey> selector,
	IComparer<TKey> comparer
)

Parameters

source
Type: System.Collections.GenericIEnumerableTSource
A sequence of values to determine the minimum value of.
selector
Type: SystemFuncTSource, TKey
A delegate used to select the values
comparer
Type: System.Collections.GenericIComparerTKey
A comparer used to compare the value defined by TKey

Type Parameters

TSource
The type of the elements of source.
TKey
The type of the elements of selector.

Return Value

Type: TSource
The minimum value in the sequence

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also