Interface IExecuteReader
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Represents an expressive command that runs a data reader and hands it to a function of the caller.
public interface IExecuteReader
- Extension Methods
Remarks
The data reader is disposed when the function returns, and a connection the command opened is closed or given back then, so do not keep the reader.
Properties
- CancellationToken
Gets the cancellation token the command uses with the methods that support one.
Methods
- ExecuteReaderAsync(Func<IDataReader, ValueTask>, CommandBehavior)
Asynchronously executes the command and passes the data reader to
handler.
- ExecuteReaderAsync<T>(Func<IDataReader, ValueTask<T>>, CommandBehavior)
Asynchronously executes the command, passes the data reader to
transformand returns its result.
- ExecuteReaderAsync<TState, TResult>(TState, Func<IDataReader, TState, ValueTask<TResult>>, CommandBehavior)
Asynchronously executes the command, passes the data reader and
statetotransform, and returns its result. Pass a static lambda and the state it needs to avoid allocating a closure per call.
- ExecuteReaderAsync<TState, TResult>(TState, Func<IDataReader, TState, ValueTask<TResult>>, CommandBehavior, CancellationToken)
Asynchronously executes the command, passes the data reader and
statetotransform, and returns its result, with the cancellation token to use for the whole call. Pass a static lambda and the state it needs to avoid allocating a closure per call.