Table of Contents

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

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

count int

The maximum number of records before complete.

behavior CommandBehavior

The behavior to use with the data reader.

Returns

ValueTask<IList<T>>

The value from the transform.

Type Parameters

T

The return type of the transform function.