Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: TSource? MaxOrNull<TSource>(this IEnumerable<TSource>)

Declaration

public static TSource? MaxOrNull<TSource>(
    this IEnumerable<TSource> source
)

Summary

Returns the maximum resulting value in a sequence, or null if the sequence is empty.

Generic type parameters

TSource
  • Must derive from: System.ValueType.
  • Must have a default constructor.
  • Must be a non-nullable value type.
The type of the elements of source.

Parameters

this IEnumerable<TSource>source A sequence of values to determine the maximum value of.

Returns

The maximum value in the sequence, or null if the sequence is empty.