Table of Contents

Struct SqlAsyncQueryReader<TRow>

Namespace
LfrlAnvil.Sql.Statements
Assembly
LfrlAnvil.Sql.Core.dll

Represents an asynchronous generic query reader.

public readonly record struct SqlAsyncQueryReader<TRow> : IEquatable<SqlAsyncQueryReader<TRow>> where TRow : notnull

Type Parameters

TRow

Row type.

Implements
Inherited Members
Extension Methods

Constructors

SqlAsyncQueryReader(SqlDialect, Func<IDataReader, SqlQueryReaderOptions, CancellationToken, ValueTask<SqlQueryResult<TRow>>>)

Represents an asynchronous generic query reader.

public SqlAsyncQueryReader(SqlDialect Dialect, Func<IDataReader, SqlQueryReaderOptions, CancellationToken, ValueTask<SqlQueryResult<TRow>>> Delegate)

Parameters

Dialect SqlDialect

SQL dialect with which this query reader is associated.

Delegate Func<IDataReader, SqlQueryReaderOptions, CancellationToken, ValueTask<SqlQueryResult<TRow>>>

Underlying delegate.

Properties

Delegate

Underlying delegate.

public Func<IDataReader, SqlQueryReaderOptions, CancellationToken, ValueTask<SqlQueryResult<TRow>>> Delegate { get; init; }

Property Value

Func<IDataReader, SqlQueryReaderOptions, CancellationToken, ValueTask<SqlQueryResult<TRow>>>

Dialect

SQL dialect with which this query reader is associated.

public SqlDialect Dialect { get; init; }

Property Value

SqlDialect

Methods

ReadAsync(IDataReader, SqlQueryReaderOptions?, CancellationToken)

Asynchronously reads a collection of rows.

[Pure]
public ValueTask<SqlQueryResult<TRow>> ReadAsync(IDataReader reader, SqlQueryReaderOptions? options = null, CancellationToken cancellationToken = default)

Parameters

reader IDataReader

IDataReader 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.