Method MaxElement
MaxElement<T, TKey>(IEnumerable<T>, Func<T, TKey>)
Finds out element with maximum value in the container.
public static T MaxElement<T, TKey>(this IEnumerable<T> container, Func<T, TKey> valuingFoo) where TKey : IComparable
Parameters
containerIEnumerable<T>The container to probe.
valuingFooFunc<T, TKey>Method calculates max value.
Returns
- T
Maximal element in the container.
Type Parameters
TThe type of the elements of the container.
TKeyThe type of key value to calculate maximum.