Return Value

Type Parameters

If type TSource implements IComparable<T>, the Max<TSource>(IEnumerable<TSource>) method uses that implementation to compare values. Otherwise, if type TSource implements IComparable, that implementation is used to compare values.

If TSource is a reference type and the source sequence is empty or contains only values that are null, this method returns null.

In Visual Basic query expression syntax, an Aggregate Into Max() clause translates to an invocation of Max.