SqlSet.FirstOrDefault Method (String, Object[])
Returns the first element of the set that satisfies a condition or a default value if no such element is found.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Syntax
public Object FirstOrDefault(
string predicate,
params Object[] parameters
)
Parameters
predicate
Type: System.String
A SQL expression to test each row for a condition.
parameters
Type: System.Object[]
The parameters to apply to the predicate.
Return Value
Type: Object
A default value if the set is empty or if no element passes the test specified by predicate; otherwise, the first element that passes the test specified by predicate.