Table of Contents

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 string

Bound 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

string

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 IDbCommand

IDbCommand to read from.

options SqlQueryReaderOptions?

Query reader options.

cancellationToken CancellationToken

Optional CancellationToken.

Returns

ValueTask<SqlQueryResult<TRow>>

ValueTask<TResult> that returns a collection of read rows.