Table of Contents

Method ExecuteReaderAsync

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

ExecuteReaderAsync<TState, TResult>(TState, Func<IDataReader, TState, ValueTask<TResult>>, CancellationToken)

Executes a reader on the command, passing state to transform.

public ValueTask<TResult> ExecuteReaderAsync<TState, TResult>(TState state, Func<IDataReader, TState, ValueTask<TResult>> transform, CancellationToken cancellationToken = default)

Parameters

state TState

The state to pass to the transform.

transform Func<IDataReader, TState, ValueTask<TResult>>

The transform function for the data reader.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask<TResult>

A task that represents the asynchronous operation; its result is the result of transform.

Type Parameters

TState

The type of the state passed to the transform.

TResult

The return type of the transform function.

ExecuteReaderAsync<TState, TResult>(TState, Func<IDataReader, TState, ValueTask<TResult>>, CommandBehavior, CancellationToken)

Executes a reader on the command, passing state to transform.

public ValueTask<TResult> ExecuteReaderAsync<TState, TResult>(TState state, Func<IDataReader, TState, ValueTask<TResult>> transform, CommandBehavior behavior, CancellationToken cancellationToken = default)

Parameters

state TState

The state to pass to the transform.

transform Func<IDataReader, TState, ValueTask<TResult>>

The transform function for the data reader.

behavior CommandBehavior

The behavior to run the reader with. The default is Default.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask<TResult>

A task that represents the asynchronous operation; its result is the result of transform.

Type Parameters

TState

The type of the state passed to the transform.

TResult

The return type of the transform function.

ExecuteReaderAsync(Action<TReader>, CommandBehavior, CancellationToken)

Executes a reader on the command with a handler action.

public ValueTask ExecuteReaderAsync(Action<TReader> handler, CommandBehavior behavior = CommandBehavior.Default, CancellationToken cancellationToken = default)

Parameters

handler Action<TReader>

The handler function for the data reader.

behavior CommandBehavior

The behavior to run the reader with. The default is Default.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask

A task that represents the asynchronous operation.

ExecuteReaderAsync(Action<TReader>, CancellationToken)

Executes a reader on the command with a handler action, and a token.

public ValueTask ExecuteReaderAsync(Action<TReader> handler, CancellationToken cancellationToken)

Parameters

handler Action<TReader>

The handler function for the data reader.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask

A task that represents the asynchronous operation.

Remarks

This overload has no behavior parameter: to pass both a behavior and a token, use the overload that takes the behavior and then the token.

ExecuteReaderAsync<T>(Func<TReader, T>, CommandBehavior, CancellationToken)

Executes a reader on the command with a transform function.

public ValueTask<T> ExecuteReaderAsync<T>(Func<TReader, T> handler, CommandBehavior behavior = CommandBehavior.Default, CancellationToken cancellationToken = default)

Parameters

handler Func<TReader, T>

The handler function for the data reader.

behavior CommandBehavior

The behavior to run the reader with. The default is Default.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask<T>

A task that represents the asynchronous operation; its result is the value returned by handler.

Type Parameters

T

The type of the result.

ExecuteReaderAsync<T>(Func<TReader, T>, CancellationToken)

Executes a reader on the command with a transform function, and a token.

public ValueTask<T> ExecuteReaderAsync<T>(Func<TReader, T> handler, CancellationToken cancellationToken)

Parameters

handler Func<TReader, T>

The handler function for the data reader.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask<T>

A task that represents the asynchronous operation; its result is the value returned by handler.

Type Parameters

T

The type of the result.

Remarks

This overload has no behavior parameter: to pass both a behavior and a token, use the overload that takes the behavior and then the token.

ExecuteReaderAsync(Func<TReader, ValueTask>, CommandBehavior, CancellationToken)

Executes a reader on the command with an asynchronous handler function.

public ValueTask ExecuteReaderAsync(Func<TReader, ValueTask> handler, CommandBehavior behavior = CommandBehavior.Default, CancellationToken cancellationToken = default)

Parameters

handler Func<TReader, ValueTask>

The handler function for the data reader.

behavior CommandBehavior

The behavior to run the reader with. The default is Default.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask

A task that represents the asynchronous operation.

ExecuteReaderAsync(Func<TReader, ValueTask>, CancellationToken)

Executes a reader on the command with an asynchronous handler function, and a token.

public ValueTask ExecuteReaderAsync(Func<TReader, ValueTask> handler, CancellationToken cancellationToken)

Parameters

handler Func<TReader, ValueTask>

The handler function for the data reader.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask

A task that represents the asynchronous operation.

Remarks

This overload has no behavior parameter: to pass both a behavior and a token, use the overload that takes the behavior and then the token.

ExecuteReaderAsync<T>(Func<TReader, ValueTask<T>>, CommandBehavior, CancellationToken)

Executes a reader on the command with an asynchronous transform function.

public ValueTask<T> ExecuteReaderAsync<T>(Func<TReader, ValueTask<T>> handler, CommandBehavior behavior = CommandBehavior.Default, CancellationToken cancellationToken = default)

Parameters

handler Func<TReader, ValueTask<T>>

The handler function for the data reader.

behavior CommandBehavior

The behavior to run the reader with. The default is Default.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask<T>

A task that represents the asynchronous operation; its result is the result of handler.

Type Parameters

T

The type of the result.

ExecuteReaderAsync<T>(Func<TReader, ValueTask<T>>, CancellationToken)

Executes a reader on the command with an asynchronous transform function, and a token.

public ValueTask<T> ExecuteReaderAsync<T>(Func<TReader, ValueTask<T>> handler, CancellationToken cancellationToken)

Parameters

handler Func<TReader, ValueTask<T>>

The handler function for the data reader.

cancellationToken CancellationToken

A token that can cancel the call. It is used together with the command's own token (see UseCancellationToken(CancellationToken)); either one cancels.

Returns

ValueTask<T>

A task that represents the asynchronous operation; its result is the result of handler.

Type Parameters

T

The type of the result.

Remarks

This overload has no behavior parameter: to pass both a behavior and a token, use the overload that takes the behavior and then the token.