Table of Contents

Method ToList

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

ToList<T>(IDbCommand, CommandBehavior, Func<IDataRecord, T>)

Iterates all records using an IDataReader and returns the desired results as a list.

public static List<T> ToList<T>(this IDbCommand command, CommandBehavior behavior, Func<IDataRecord, T> transform)

Parameters

command IDbCommand

The IDbCommand to generate a reader from.

behavior CommandBehavior

The behavior to use with the data reader.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

Returns

List<T>

Type Parameters

T

The return type of the transform function.

ToList<T>(IDbCommand, Func<IDataRecord, T>, CommandBehavior)

Iterates all records using an IDataReader and returns the desired results as a list.

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

Parameters

command IDbCommand

The IDbCommand to generate a reader from.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

behavior CommandBehavior

The behavior to use with the data reader.

Returns

List<T>

Type Parameters

T

The return type of the transform function.