AlgorithmsTryFindFirstWhereT Method |
Finds the first item in a collection that satisfies the condition
defined by predicate.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static bool TryFindFirstWhere<T>(
IEnumerable<T> collection,
Predicate<T> predicate,
out T foundItem
)
public:
generic<typename T>
static bool TryFindFirstWhere(
IEnumerable<T>^ collection,
Predicate<T>^ predicate,
[OutAttribute] T% foundItem
)
Parameters
- collection
- Type: System.Collections.GenericIEnumerableT
The collection to search. - predicate
- Type: SystemPredicateT
A delegate that defined the condition to check for. - foundItem
- Type: T
Outputs the first item in the collection that matches the condition, if the method returns true.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.TryFindFirstWhere``1(System.Collections.Generic.IEnumerable{``0},System.Predicate{``0},``0@)"]
Return Value
Type:
BooleanTrue if an item satisfying the condition was found. False if no such item exists in the collection.
See Also