Click or drag to resize

EnumerableExtensionsMaxOrDefaultT(IEnumerableT, T) Method

Evaluates the maximum of a enumeration of elements, or returns a default value if the series is empty.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static T MaxOrDefault<T>(
	this IEnumerable<T> seq,
	T defaultValue
)
where T : Object, IComparable<T>

Parameters

seq  IEnumerableT
The enumeration.
defaultValue  T
The default value that is returned if the enumeration is empty.

Type Parameters

T
Type of element

Return Value

T
The maximum of of all elements, or the defaultValue if the series is empty.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. 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).
See Also