Table of Contents

Struct SqlAsyncScalarQueryReaderExecutor<T>

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

Represents an SqlAsyncScalarQueryReader<T> bound to a specific Sql statement.

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

Type Parameters

T

Value type.

Implements
Inherited Members

Constructors

SqlAsyncScalarQueryReaderExecutor(SqlAsyncScalarQueryReader<T>, string)

Represents an SqlAsyncScalarQueryReader<T> bound to a specific Sql statement.

public SqlAsyncScalarQueryReaderExecutor(SqlAsyncScalarQueryReader<T> Reader, string Sql)

Parameters

Reader SqlAsyncScalarQueryReader<T>

Underlying query reader.

Sql string

Bound SQL statement.

Properties

Reader

Underlying query reader.

public SqlAsyncScalarQueryReader<T> Reader { get; init; }

Property Value

SqlAsyncScalarQueryReader<T>

Sql

Bound SQL statement.

public string Sql { get; init; }

Property Value

string

Methods

ExecuteAsync(IDbCommand, CancellationToken)

Asynchronously creates an IDataReader instance and reads a scalar value, using the specified Sql statement.

[Pure]
public ValueTask<SqlScalarQueryResult<T>> ExecuteAsync(IDbCommand command, CancellationToken cancellationToken = default)

Parameters

command IDbCommand

IDbCommand to read from.

cancellationToken CancellationToken

Optional CancellationToken.

Returns

ValueTask<SqlScalarQueryResult<T>>

ValueTask<TResult> that returns a read scalar value.