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
commandIDbCommandThe IDbCommand to generate a reader from.
skipintThe number of entries to skip before starting to take results.
takeintThe maximum number of records to return.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
behaviorCommandBehaviorThe behavior to use with the data reader.
Returns
- List<T>
The results from the skip, transform and take operation.
Type Parameters
TThe return type of the transform function.