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 query.
public MappedQuery<T> Map<T>()
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Type Parameters
TThe type each row is mapped to.
Remarks
The same as Map<T>(IExecuteReader).
Exceptions
- InvalidOperationException
This is a default value, which is bound to nothing.
Map<T>(RowMap<T>?)
Maps each row to a T with a map the caller declared, and returns the mapped query.
public MappedQuery<T> Map<T>(RowMap<T>? map)
Parameters
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Type Parameters
TThe type each row is mapped to.
Exceptions
- InvalidOperationException
This is a default value, which is bound to nothing.
Map<T>(Func<IDataRecord, T>)
Maps each row with a selector, and returns the mapped query.
public MappedQuery<T> Map<T>(Func<IDataRecord, T> selector)
Parameters
selectorFunc<IDataRecord, T>Called for each row, from any thread and by overlapping calls, so it must be safe for concurrent use.
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Type Parameters
TThe type each row is mapped to.
Exceptions
- ArgumentNullException
selectoris null.- InvalidOperationException
This is a default value, which is bound to nothing.