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
Public method FirstOrDefault() Returns the first element of the set, or a default value if the set contains no elements.
Public method 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.

See Also

Reference

SqlSet Class
DbExtensions Namespace

© Max Toro Q.