CollectionUtils FirstOrAnyOrDefault TResult  Method NFX Class Library

[This is preliminary documentation and is subject to change.]

Tries to find the first element that matches the predicate and returns it, otherwise returns the first element found or default (i.e. null)

Namespace: NFX
Assembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
Syntax

public static TResult FirstOrAnyOrDefault<TResult>(
	this IEnumerable<TResult> source,
	Func<TResult, bool> predicate
)

Parameters

source
Type: OnlineSystem.Collections.Generic IEnumerable TResult 
predicate
Type: OnlineSystem Func TResult, OnlineBoolean 
Type Parameters

TResult

Return Value

Type: TResult

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type OnlineIEnumerable TResult . When you use instance method syntax to call this method, omit the first parameter. For more information, see OnlineExtension Methods (Visual Basic) or OnlineExtension Methods (C# Programming Guide).
See Also