Whetstone Class reference
Whetstone Class reference
Whetstone
WhetStone Namespaces
WhetStone.Looping
first Class
first Methods
FirstOrDefault Method
FirstOrDefault(T) Method (IEnumerable(T), T)
FirstOrDefault(T) Method (IEnumerable(T), Func(T, Boolean), T)
FirstOrDefault(T) Method (IEnumerable(T), Func(T, Boolean), Boolean, T)
first
FirstOrDefault
T
Method (IEnumerable
T
, Func
T
, Boolean
,
T
)
Get the
IEnumerable
T
's first value to fulfill a condition or a default value.
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
Copy
public
static
T
FirstOrDefault
<T>(
this
IEnumerable
<T>
this
,
Func
<T,
bool
>
cond
, T
def
)
Parameters
this
Type:
System.Collections.Generic
IEnumerable
T
The
IEnumerable
T
to check.
cond
Type:
System
Func
T
,
Boolean
The condition to qualify members for being returned.
def
Type:
T
The value to return if
this
is empty of qualified members.
Type Parameters
T
The
IEnumerable
T
's type.
Return Value
Type:
T
The first value in
this
to pass
cond
or
def
if none to.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable
T
. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic)
or
Extension Methods (C# Programming Guide)
.
See Also
Reference
first Class
FirstOrDefault Overload
WhetStone.Looping Namespace