Table of Contents

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

T

The type each row is mapped to.

Remarks

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

map RowMap<T>

The map. A null map reads as Map<T>() does.

Returns

MappedQuery<T>

The mapped query, to be read with a terminal.

Type Parameters

T

The 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

selector Func<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

T

The type each row is mapped to.

Exceptions

ArgumentNullException

selector is null.

InvalidOperationException

This is a default value, which is bound to nothing.