Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: T MaxElementOrDefault<T, TValue>(this IEnumerable<T>, Func<T, TValue>, T)

Declaration

public static T MaxElementOrDefault<T, TValue>(
    this IEnumerable<T> source,
    Func<T, TValue> valueSelector,
    T defaultValue = null
)

Summary

Returns the first element from the input sequence for which the value selector returns the largest value, or a default value if the collection is empty.

Generic type parameters

TThis type parameter is not documented.
TValue
  • Must derive from: System.IComparable<TValue>.
This type parameter is not documented.