Method Map
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Map<T>()
Maps each row to a T by column name (a single value such as
int is read from the first column), and returns the mapped definition.
public MappedDbQuery<T> Map<T>()
Returns
- MappedDbQuery<T>
The mapped definition.
Type Parameters
TThe type each row is mapped to.
Remarks
The result is immutable and has no connection yet, so it can be held in a static field;
give it a source with Using and read it with a terminal.
Map<T>(RowMap<T>?)
Maps each row to a T with a map the caller declared, and returns the mapped definition.
public MappedDbQuery<T> Map<T>(RowMap<T>? map)
Parameters
Returns
- MappedDbQuery<T>
The mapped definition.
Type Parameters
TThe type each row is mapped to.
Map<T>(Func<IDataRecord, T>)
Maps each row with a selector, and returns the mapped definition.
public MappedDbQuery<T> Map<T>(Func<IDataRecord, T> selector)
Parameters
selectorFunc<IDataRecord, T>Called for each row, from any thread and by overlapping calls of the same definition, so it must be safe for concurrent use.
Returns
- MappedDbQuery<T>
The mapped definition.
Type Parameters
TThe type each row is mapped to.
Exceptions
- ArgumentNullException
selectoris null.