DmQuery`2
Namespace: MJCZone.DapperMatic.Dml
Assembly: MJCZone.DapperMatic
Summary
A query whose rows are read as something else, such as some of their columns.
sealed public
Contents
Methods (9)
Methods
| Method | Summary |
|---|---|
| Distinct | Returns each distinct result once. The selector must be of columns only, such as <c>o => ne... |
| ToListAsync | Reads the results. |
| FirstAsync | Reads the first result: in the query's order, or in key order if it has none. |
| SingleAsync | Reads the one result the query returns. |
| ToSql | Writes the SQL that CancellationToken) runs, without running it.... |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
Distinct
Returns each distinct result once. The selector must be of columns only, such as <c>o => new { o.CustomerId, o.Status }</c>, since the database compares them.
DmQuery<T, TResult> Distinct()Returns
Type: DmQuery<T, TResult>
The query.
ToListAsync
Reads the results.
Task<List<TResult>> ToListAsync(
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- tx (IDbTransaction) - The transaction to use, or null.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<List<TResult>>
The results.
FirstAsync
Reads the first result: in the query's order, or in key order if it has none.
Task<TResult?> FirstAsync(
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- tx (IDbTransaction) - The transaction to use, or null.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<TResult?>
The result, or the default (null for a class) if there is none.
SingleAsync
Reads the one result the query returns.
Task<TResult?> SingleAsync(
IDbTransaction tx,
CancellationToken cancellationToken)Parameters
- tx (IDbTransaction) - The transaction to use, or null.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<TResult?>
The result, or the default (null for a class) if there is none.
ToSql
Writes the SQL that CancellationToken) runs, without running it.
DmStatement ToSql()Returns
Type: DmStatement
The SQL and its parameters.
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()