Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: TResult? MinOrNull<TSource, TResult>(this IEnumerable<TSource>, Func<TSource, TResult>)

Declaration

public static TResult? MinOrNull<TSource, TResult>(
    this IEnumerable<TSource> source,
    Func<TSource, TResult> selector
)

Summary

Invokes a selector on each element of a collection and returns the minimum resulting value, or null if the sequence is empty.

Generic type parameters

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

Parameters

this IEnumerable<TSource>source A sequence of values to determine the minimum value of.
Func<TSource, TResult>selector A transform function to apply to each element.

Returns

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