Method ExecuteReader
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ExecuteReader(Action<TReader>, CommandBehavior)
Executes a reader on a command with a handler function.
void ExecuteReader(Action<out TReader> handler, CommandBehavior behavior = CommandBehavior.Default)
Parameters
handlerAction<TReader>The handler function for the data reader.
behaviorCommandBehaviorThe command behavior for once the command the reader is complete.
ExecuteReader<T>(Func<TReader, T>, CommandBehavior)
Executes a reader on a command with a transform function.
T ExecuteReader<T>(Func<out TReader, T> transform, CommandBehavior behavior = CommandBehavior.Default)
Parameters
transformFunc<TReader, T>The transform function for each IDataRecord.
behaviorCommandBehaviorThe command behavior for once the command the reader is complete.
Returns
- T
The result of the transform.
Type Parameters
TThe return type of the transform function.