Method Results
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Results<T>(IDataReader, params IEnumerable<KeyValuePair<string, string?>>?)
Iterates each record and attempts to map the fields to type T.
public static IEnumerable<T> Results<T>(this IDataReader reader, params IEnumerable<KeyValuePair<string, string?>>? fieldMappingOverrides) where T : new()
Parameters
readerIDataReaderThe IDataReader to read results 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>
The enumerable to pull the transformed results from.
Type Parameters
TThe model type to map the values to (using reflection).
Results<T>(IDataReader)
Iterates each record and attempts to map the fields to type T.
public static IEnumerable<T> Results<T>(this IDataReader reader) where T : new()
Parameters
readerIDataReaderThe IDataReader to read results from.
Returns
- IEnumerable<T>
The enumerable to pull the transformed results from.
Type Parameters
TThe model type to map the values to (using reflection).
Results<T>(IDataReader, params IEnumerable<(string Field, string? Column)>?)
Iterates each record and attempts to map the fields to type T.
public static IEnumerable<T> Results<T>(this IDataReader reader, params IEnumerable<(string Field, string? Column)>? fieldMappingOverrides) where T : new()
Parameters
readerIDataReaderThe IDataReader to read results 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>
The enumerable to pull the transformed results from.
Type Parameters
TThe model type to map the values to (using reflection).
Results<T>(IDbCommand, params IEnumerable<KeyValuePair<string, string?>>?)
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> Results<T>(this IDbCommand command, params IEnumerable<KeyValuePair<string, string?>>? fieldMappingOverrides) where T : new()
Parameters
commandIDbCommandThe command to generate a reader 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>
The enumerable to pull the transformed results from.
Type Parameters
TThe model type to map the values to (using reflection).
Results<T>(IDbCommand)
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> Results<T>(this IDbCommand command) where T : new()
Parameters
commandIDbCommandThe command to generate a reader from.
Returns
- IEnumerable<T>
The enumerable to pull the transformed results from.
Type Parameters
TThe model type to map the values to (using reflection).
Results<T>(IDbCommand, params IEnumerable<(string Field, string? Column)>?)
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> Results<T>(this IDbCommand command, params IEnumerable<(string Field, string? Column)>? fieldMappingOverrides) where T : new()
Parameters
commandIDbCommandThe command to generate a reader 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>
The enumerable to pull the transformed results from.
Type Parameters
TThe model type to map the values to (using reflection).