TEnumerableBase<T>.SingleOrDefault(T) Method

Returns the only element of a sequence, or the specified default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

Namespace: Spring.Collections.Base
public
 function SingleOrDefault(const defaultValue: T): T; overload; virtual;

Parameters

defaultValue
Type: T

Return Value

Type: T

 

Implements

IEnumerable<T>.SingleOrDefault(T)