Table of Contents

Method SkipThenTake

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

SkipThenTake<T>(IDbCommand, int, int, Func<IDataRecord, T>, CommandBehavior)

Iterates an IDataReader and skips by the skip parameter returns the maximum remaining defined by the take parameter.

public static List<T> SkipThenTake<T>(this IDbCommand command, int skip, int take, Func<IDataRecord, T> transform, CommandBehavior behavior = CommandBehavior.Default)

Parameters

command IDbCommand

The IDbCommand to generate a reader from.

skip int

The number of entries to skip before starting to take results.

take int

The maximum number of records to return.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

behavior CommandBehavior

The behavior to use with the data reader.

Returns

List<T>

The results from the skip, transform and take operation.

Type Parameters

T

The return type of the transform function.