Struct SqlAsyncQueryReaderExecutor<TRow>
- Namespace
- LfrlAnvil.Sql.Statements
- Assembly
- LfrlAnvil.Sql.Core.dll
Represents an SqlAsyncQueryReader<TRow> bound to a specific Sql statement.
public readonly record struct SqlAsyncQueryReaderExecutor<TRow> : IEquatable<SqlAsyncQueryReaderExecutor<TRow>> where TRow : notnull
Type Parameters
TRow
Row type.
- Implements
- Inherited Members
Constructors
SqlAsyncQueryReaderExecutor(SqlAsyncQueryReader<TRow>, string)
Represents an SqlAsyncQueryReader<TRow> bound to a specific Sql statement.
public SqlAsyncQueryReaderExecutor(SqlAsyncQueryReader<TRow> Reader, string Sql)
Parameters
Reader
SqlAsyncQueryReader<TRow>Underlying query reader.
Sql
stringBound SQL statement.
Properties
Reader
Underlying query reader.
public SqlAsyncQueryReader<TRow> Reader { get; init; }
Property Value
- SqlAsyncQueryReader<TRow>
Sql
Bound SQL statement.
public string Sql { get; init; }
Property Value
Methods
ExecuteAsync(IDbCommand, SqlQueryReaderOptions?, CancellationToken)
Asynchronously creates an IDataReader instance and reads a collection of rows, using the specified Sql statement.
[Pure]
public ValueTask<SqlQueryResult<TRow>> ExecuteAsync(IDbCommand command, SqlQueryReaderOptions? options = null, CancellationToken cancellationToken = default)
Parameters
command
IDbCommandIDbCommand to read from.
options
SqlQueryReaderOptions?Query reader options.
cancellationToken
CancellationTokenOptional CancellationToken.
Returns
- ValueTask<SqlQueryResult<TRow>>
ValueTask<TResult> that returns a collection of read rows.