SqlSet.SingleOrDefault Method (String, Object[])

Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

Namespace:  DbExtensions
Assembly: DbExtensions.dll

Syntax

public Object SingleOrDefault(
	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
The single element of the set that satisfies the condition, or a default value if no such element is found.

See Also

Reference

SqlSet Class
DbExtensions Namespace

© Max Toro Q.