ImmutableArrayExtensions::FirstOrDefault<T> Method (ImmutableArray<T>, Func<T, Boolean>^)

 

Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

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

public:
generic<typename T>
[ExtensionAttribute]
static T FirstOrDefault(
	ImmutableArray<T> immutableArray,
	Func<T, bool>^ predicate
)

Parameters

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

The array to retrieve elments from.

predicate
Type: System::Func<T, Boolean>^

The delegate that defines the conditions of the element to search for.

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: