SqlSet.FirstOrDefault Method
Returns the first element of the set, or a default value if the set contains no elements.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Overloads
| Name | Description | |
|---|---|---|
| FirstOrDefault() | Returns the first element of the set, or a default value if the set contains no elements. | |
| FirstOrDefault(String, Object[]) | Returns the first element of the set that satisfies a condition or a default value if no such element is found. |
Syntax
public Object FirstOrDefault()
Return Value
Object
A default value if the set is empty; otherwise, the first element.