Method ExecuteReaderAsync
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ExecuteReaderAsync(Func<IDataReader, ValueTask>, CommandBehavior)
Executes a reader on a command with a handler function.
ValueTask ExecuteReaderAsync(Func<IDataReader, ValueTask> handler, CommandBehavior behavior = CommandBehavior.Default)
Parameters
handlerFunc<IDataReader, ValueTask>The handler function for the data reader.
behaviorCommandBehaviorThe command behavior for once the command the reader is complete.
Returns
ExecuteReaderAsync<T>(Func<IDataReader, ValueTask<T>>, CommandBehavior)
Executes a reader on a command with a handler function.
ValueTask<T> ExecuteReaderAsync<T>(Func<IDataReader, ValueTask<T>> transform, CommandBehavior behavior = CommandBehavior.Default)
Parameters
transformFunc<IDataReader, ValueTask<T>>The transform function for each IDataRecord.
behaviorCommandBehaviorThe command behavior for once the command the reader is complete.
Returns
- ValueTask<T>
Type Parameters
T
ExecuteReaderAsync<TState, TResult>(TState, Func<IDataReader, TState, ValueTask<TResult>>, CommandBehavior)
Executes a reader on a command, passing state to transform.
Pass a static lambda and the state it needs to avoid allocating a closure per call.
ValueTask<TResult> ExecuteReaderAsync<TState, TResult>(TState state, Func<IDataReader, TState, ValueTask<TResult>> transform, CommandBehavior behavior = CommandBehavior.Default)
Parameters
stateTStateThe state to pass to the transform.
transformFunc<IDataReader, TState, ValueTask<TResult>>The transform function for the data reader.
behaviorCommandBehaviorThe command behavior for once the command the reader is complete.
Returns
- ValueTask<TResult>
The result of the transform.
Type Parameters
TStateThe type of the state passed to the transform.
TResultThe return type of the transform function.