Table of Contents

Method ResultsFromDataTable

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

ResultsFromDataTable<T>(IDataReader, IEnumerable<KeyValuePair<string, string?>>?)

Loads all data into a DataTable before Iterates each record and attempts to map the fields to type T. Data is temporarily stored (buffered in entirety) in a queue before applying the transform for each iteration.

public static IEnumerable<T> ResultsFromDataTable<T>(this IDataReader reader, IEnumerable<KeyValuePair<string, string?>>? fieldMappingOverrides = null) where T : new()

Parameters

reader IDataReader

The IDataReader to read results from.

fieldMappingOverrides IEnumerable<KeyValuePair<string, string>>

An optional override map of field names to column names where the keys are the property names, and values are the column names.

Returns

IEnumerable<T>

The enumerable to pull the transformed results from.

Type Parameters

T

The model type to map the values to (using reflection).

ResultsFromDataTable<T>(IDataReader, params IEnumerable<(string Field, string? Column)>?)

Loads all data into a DataTable before Iterates each record and attempts to map the fields to type T. Data is temporarily stored (buffered in entirety) in a queue before applying the transform for each iteration.

public static IEnumerable<T> ResultsFromDataTable<T>(this IDataReader reader, params IEnumerable<(string Field, string? Column)>? fieldMappingOverrides) where T : new()

Parameters

reader IDataReader

The IDataReader to read results from.

fieldMappingOverrides IEnumerable<(string Field, string Column)>

An optional override map of field names to column names where the keys are the property names, and values are the column names.

Returns

IEnumerable<T>

The enumerable to pull the transformed results from.

Type Parameters

T

The model type to map the values to (using reflection).

ResultsFromDataTable<T>(IDbCommand, IEnumerable<KeyValuePair<string, string?>>?)

Loads all data into a DataTable before Iterates each record and attempts to map the fields to type T. Data is temporarily stored (buffered in entirety) in a queue before applying the transform for each iteration.

public static IEnumerable<T> ResultsFromDataTable<T>(this IDbCommand command, IEnumerable<KeyValuePair<string, string?>>? fieldMappingOverrides = null) where T : new()

Parameters

command IDbCommand

The command to generate a reader from.

fieldMappingOverrides IEnumerable<KeyValuePair<string, string>>

An optional override map of field names to column names where the keys are the property names, and values are the column names.

Returns

IEnumerable<T>

The enumerable to pull the transformed results from.

Type Parameters

T

The model type to map the values to (using reflection).

ResultsFromDataTable<T>(IDbCommand, params IEnumerable<(string Field, string? Column)>?)

Loads all data into a DataTable before Iterates each record and attempts to map the fields to type T. Data is temporarily stored (buffered in entirety) in a queue before applying the transform for each iteration.

public static IEnumerable<T> ResultsFromDataTable<T>(this IDbCommand command, params IEnumerable<(string Field, string? Column)>? fieldMappingOverrides) where T : new()

Parameters

command IDbCommand

The command to generate a reader from.

fieldMappingOverrides IEnumerable<(string Field, string Column)>

An optional override map of field names to column names where the keys are the property names, and values are the column names.

Returns

IEnumerable<T>

The enumerable to pull the transformed results from.

Type Parameters

T

The model type to map the values to (using reflection).