EntityConnectionExtensions.CountAsync<TRow> method (1 of 2)
Asynchronously gets count of all records.
public static Task<int> CountAsync<TRow>(this IDbConnection connection,
CancellationToken cancellationToken = default)
where TRow : class, IRow, new()
| parameter | description |
|---|---|
| TRow | The type of the row. |
| connection | The connection. |
| cancellationToken | The cancellation token. |
Return Value
A task representing the asynchronous operation. The task result is the number of records in the table.
See Also
- interface IRow
- class EntityConnectionExtensions
EntityConnectionExtensions.CountAsync<TRow> method (2 of 2)
Asynchronously gets count of records matching a specified criteria.
public static Task<int> CountAsync<TRow>(this IDbConnection connection, ICriteria where,
CancellationToken cancellationToken = default)
where TRow : class, IRow, new()
| parameter | description |
|---|---|
| TRow | The type of the row. |
| connection | The connection. |
| where | The where criteria. |
| cancellationToken | The cancellation token. |
Return Value
A task representing the asynchronous operation. The task result is the number of records matching the specified criteria.
See Also
- interface ICriteria
- interface IRow
- class EntityConnectionExtensions