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
tableDataTableThe DataTable to read from.
fieldMappingOverridesIEnumerable<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.
clearSourceTableboolClears the source table before providing the enumeration.
Returns
- IEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe 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
tableDataTableThe DataTable to read from.
fieldMappingOverridesIEnumerable<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
TThe 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
tableDataTableThe DataTable to read from.
fieldMappingOverridesIEnumerable<(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.
clearSourceTableboolClears the source table before providing the enumeration.
Returns
- IEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe 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
tableDataTableThe DataTable to read from.
fieldMappingOverridesIEnumerable<(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
TThe model type to map the values to (using reflection).