TListBase<T>.FirstOrDefault(T) Method

Returns the first element of a sequence, or the specified default value if the sequence contains no elements.

Namespace: Spring.Collections.Base
public
 function FirstOrDefault(const defaultValue: T): T; overload; override;

Parameters

defaultValue
Type: T

The value to return if the sequence contains no elements.

Return Value

Type: T

DefaultValue if source is empty; otherwise, the first element in source.

Overrides

TEnumerableBase<T>.FirstOrDefault(T)