Table of Contents

Method To

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

To<T>(DataTable, IEnumerable<KeyValuePair<string, string?>>?, bool)

Loads all data into a queue before iterating (dequeuing) the results as type T.

public static IEnumerable<T> To<T>(this DataTable table, IEnumerable<KeyValuePair<string, string?>>? fieldMappingOverrides = null, bool clearSourceTable = false) where T : new()

Parameters

table DataTable

The DataTable to read 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.

clearSourceTable bool

Clears the source table before providing the enumeration.

Returns

IEnumerable<T>

An enumerable used to iterate the results.

Type Parameters

T

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

To<T>(DataTable, params IEnumerable<KeyValuePair<string, string?>>?)

Loads all data into a queue before iterating (dequeuing) the results as type T.

public static IEnumerable<T> To<T>(this DataTable table, params IEnumerable<KeyValuePair<string, string?>>? fieldMappingOverrides) where T : new()

Parameters

table DataTable

The DataTable to read 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>

An enumerable used to iterate the results.

Type Parameters

T

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

To<T>(DataTable, IEnumerable<(string Field, string? Column)>?, bool)

Loads all data into a queue before iterating (dequeuing) the results as type T.

public static IEnumerable<T> To<T>(this DataTable table, IEnumerable<(string Field, string? Column)>? fieldMappingOverrides = null, bool clearSourceTable = false) where T : new()

Parameters

table DataTable

The DataTable to read 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.

clearSourceTable bool

Clears the source table before providing the enumeration.

Returns

IEnumerable<T>

An enumerable used to iterate the results.

Type Parameters

T

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

To<T>(DataTable, params IEnumerable<(string Field, string? Column)>?)

Loads all data into a queue before iterating (dequeuing) the results as type T.

public static IEnumerable<T> To<T>(this DataTable table, params IEnumerable<(string Field, string? Column)>? fieldMappingOverrides) where T : new()

Parameters

table DataTable

The DataTable to read 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>

An enumerable used to iterate the results.

Type Parameters

T

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