Click or drag to resize

CondensedCollectionExtensionsMaxTSource Method (CondensedCollectionTSource)

[This is preliminary documentation and is subject to change.]

Returns the maximum value in a generic sequence. Optimized for a CondensedCollection.

Namespace:  Condensed.Linq
Assembly:  Condensed (in Condensed.dll) Version: 0.1.0.0 (0.1.0.0)
Syntax
public static TSource Max<TSource>(
	this CondensedCollection<TSource> source
)

Parameters

source
Type: CondensedCondensedCollectionTSource
A sequence of values to determine the maximum value of.

Type Parameters

TSource
The type of the elements of source.

Return Value

Type: TSource
The maximum value in the sequence or, if TSource is reference type, null if source is empty or contains only null values.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CondensedCollectionTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionsource is null
InvalidOperationExceptionsource is a value type contains no elements
Remarks
This implementation of Max() is specialized for a CondensedCollection and tries to take advantage of the CondensedCollection's knowledge of unique values in order to improve performance. If you would rather use the normal LINQ extension method then cast the CondensedCollection to an IListT to use the Max(IEnumerableInt32) implementation.
See Also