Table of Contents

Method ToList

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

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

Converts all IDataRecords into a list using a transform function.

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

Parameters

command IExecuteReader

The IExecuteReader to iterate.

transform Func<IDataRecord, T>

The transform function.

behavior CommandBehavior

The command behavior for once the command the reader is complete.

Returns

List<T>

The list of transformed records.

Type Parameters

T

The expected return type.