Method TakeAsync
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
TakeAsync<T>(Func<IDataRecord, T>, int, CommandBehavior)
Asynchronously iterates a IDataReader and returns the each result until the count is met.
public ValueTask<IList<T>> TakeAsync<T>(Func<IDataRecord, T> transform, int count, CommandBehavior behavior = CommandBehavior.Default)
Parameters
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
countintThe maximum number of records before complete.
behaviorCommandBehaviorThe behavior to use with the data reader.
Returns
Type Parameters
TThe return type of the transform function.