SqlSet.First(String, Object[]) Method
Returns the first element in the set that satisfies a specified condition.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Overloads
Name | Description | |
---|---|---|
First() | Returns the first element of the set. | |
First(String, Object[]) | Returns the first element in the set that satisfies a specified condition. |
Syntax
public Object First(
string predicate,
params Object[] parameters
)
Parameters
predicate String
A SQL expression to test each row for a condition.
parameters Object[]
The parameters to apply to the predicate.
Return Value
Object
The first element in the set that passes the test in the specified predicate.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | No element satisfies the condition in predicate.-or-The set is empty. |