Skip to content

FirstOrDefault Method ​

Definition ​

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Task<T> FirstOrDefault(QueryBuilder<T> query, CancellationToken cancellationToken = null) ​

csharp
Task<T> FirstOrDefault(QueryBuilder<T> query, CancellationToken cancellationToken = null)

Returns the first record matching the provided query, or null if no rows match.

Type parameters ​

NameDescription
TThe entity (row) type.

Parameters ​

NameDescription
cancellationTokenCancellation token.
queryQuery describing predicates, joins, ordering, and projection.