ImmutableArrayExtensions::Single<T> Method (ImmutableArray<T>)
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
public: generic<typename T> [ExtensionAttribute] static T Single( ImmutableArray<T> immutableArray )
Parameters
- immutableArray
-
Type:
System.Collections.Immutable::ImmutableArray<T>
The array to retrieve the element from.
Return Value
Type: TThe element in the sequence.
Type Parameters
- T
The type of element contained by the collection.
Show: