Table of Contents

Struct SqlAsyncScalarQueryReaderExecutor

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

Represents an SqlAsyncScalarQueryReader bound to a specific Sql statement.

public readonly record struct SqlAsyncScalarQueryReaderExecutor : IEquatable<SqlAsyncScalarQueryReaderExecutor>
Implements
Inherited Members

Constructors

SqlAsyncScalarQueryReaderExecutor(SqlAsyncScalarQueryReader, string)

Represents an SqlAsyncScalarQueryReader bound to a specific Sql statement.

public SqlAsyncScalarQueryReaderExecutor(SqlAsyncScalarQueryReader Reader, string Sql)

Parameters

Reader SqlAsyncScalarQueryReader

Underlying query reader.

Sql string

Bound SQL statement.

Properties

Reader

Underlying query reader.

public SqlAsyncScalarQueryReader Reader { get; init; }

Property Value

SqlAsyncScalarQueryReader

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> ExecuteAsync(IDbCommand command, CancellationToken cancellationToken = default)

Parameters

command IDbCommand

IDbCommand to read from.

cancellationToken CancellationToken

Optional CancellationToken.

Returns

ValueTask<SqlScalarQueryResult>

ValueTask<TResult> that returns a read scalar value.