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

 

Returns the first element in an array.

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

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

Parameters

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

The array to get an item from.

Return Value

Type: T

The first item in the array.

Type Parameters

T

The type of element contained by the collection.

Exception Condition
InvalidOperationException

If the array is empty.

Return to top
Show: