Click or drag to resize

ExtensionsMaxByTSource, TKey Method (IEnumerableTSource, FuncTSource, TKey)

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

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static TSource MaxBy<TSource, TKey>(
	this IEnumerable<TSource> source,
	Func<TSource, TKey> selector
)

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

Type Parameters

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

Return Value

Type: TSource
The maximum 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