SqlSet<TResult>.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 TResult 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: TResult
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.

See Also

Reference

SqlSet<TResult> Class
DbExtensions Namespace

© Max Toro Q.