Table of Contents

Struct SqlAsyncScalarQueryReader<T>

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

Represents an asynchronous generic scalar query reader.

public readonly record struct SqlAsyncScalarQueryReader<T> : IEquatable<SqlAsyncScalarQueryReader<T>>

Type Parameters

T

Value type.

Implements
Inherited Members
Extension Methods

Constructors

SqlAsyncScalarQueryReader(SqlDialect, Func<IDataReader, CancellationToken, ValueTask<SqlScalarQueryResult<T>>>)

Represents an asynchronous generic scalar query reader.

public SqlAsyncScalarQueryReader(SqlDialect Dialect, Func<IDataReader, CancellationToken, ValueTask<SqlScalarQueryResult<T>>> Delegate)

Parameters

Dialect SqlDialect

SQL dialect with which this query reader is associated.

Delegate Func<IDataReader, CancellationToken, ValueTask<SqlScalarQueryResult<T>>>

Underlying delegate.

Properties

Delegate

Underlying delegate.

public Func<IDataReader, CancellationToken, ValueTask<SqlScalarQueryResult<T>>> Delegate { get; init; }

Property Value

Func<IDataReader, CancellationToken, ValueTask<SqlScalarQueryResult<T>>>

Dialect

SQL dialect with which this query reader is associated.

public SqlDialect Dialect { get; init; }

Property Value

SqlDialect

Methods

ReadAsync(IDataReader, CancellationToken)

Asynchronously reads a scalar value.

[Pure]
public ValueTask<SqlScalarQueryResult<T>> ReadAsync(IDataReader reader, CancellationToken cancellationToken = default)

Parameters

reader IDataReader

IDataReader to read from.

cancellationToken CancellationToken

Optional CancellationToken.

Returns

ValueTask<SqlScalarQueryResult<T>>

ValueTask<TResult> that returns a read scalar value.