System.Linq.Enumerable.Max Method

Returns the maximum value in a sequence of nullable decimal values.

Syntax

public static Nullable<decimal> Max (this IEnumerable<Nullable<decimal>> source)

Parameters

source
A sequence of nullable decimal values to determine the maximum value of.

Returns

A value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb that corresponds to the maximum value in the sequence. 

Remarks

The Enumerable.Max(IEnumerable<Nullable<decimal>>) method uses the decimal implementation of IComparable`1 to compare values.

If the source sequence is empty or contains only values that are null, this function returns null.

In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of erload:System.Linq.Enumerable.Max.

Requirements

Namespace: System.Linq
Assembly: System.Core (in System.Core.dll)
Assembly Versions: 3.5.0.0, 4.0.0.0