ImmutableArrayExtensions::FirstOrDefault<T> Method (ImmutableArray<T>)

 

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

Namespace:   System.Linq
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public:
generic<typename T>
[ExtensionAttribute]
static T FirstOrDefault(
	ImmutableArray<T> immutableArray
)

Parameters

immutableArray
Type: System.Collections.Immutable::ImmutableArray<T>

The array to retrieve items from.

Return Value

Type: T

The first item in the list, if found; otherwise the default value for the item type.

Type Parameters

T

The type of element contained by the collection.

Return to top
Show: