Table of Contents

Method AsDictionaryRows

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

AsDictionaryRows(IExecuteReader)

Reads each row of a query without a model, as a DictionaryRow (the values and the column names).

public static MappedQuery<DictionaryRow> AsDictionaryRows(this IExecuteReader command)

Parameters

command IExecuteReader

The command to read from.

Returns

MappedQuery<DictionaryRow>

The deferred query; nothing runs until a terminal does.

Remarks

The same as AsObjectArrays(IExecuteReader), with the names. A DictionaryRow holds the row's values; the column names are shared by every row of the result set. Use ToDictionary() for a copy the caller owns. A result set with no rows gives no rows, so no names.

Exceptions

ArgumentNullException

command is null.

AsDictionaryRows(IDbCommand)

Reads each row of a query without a model, as a DictionaryRow (the values and the column names).

public static MappedCommand<DictionaryRow> AsDictionaryRows(this IDbCommand command)

Parameters

command IDbCommand

The command to read from.

Returns

MappedCommand<DictionaryRow>

The deferred query; nothing runs until a terminal does.

Remarks

The same as AsObjectArrays(IExecuteReader), with the names. A DictionaryRow holds the row's values; the column names are shared by every row of the result set. Use ToDictionary() for a copy the caller owns. A result set with no rows gives no rows, so no names.

Exceptions

ArgumentNullException

command is null.

AsDictionaryRows(IDataReader)

Reads each row of a reader without a model, as a DictionaryRow (the values and the column names).

public static MappedReader<DictionaryRow> AsDictionaryRows(this IDataReader reader)

Parameters

reader IDataReader

The reader the caller owns, positioned on the result set to read; it is never read through.

Returns

MappedReader<DictionaryRow>

The deferred view; nothing runs until a terminal does.

Remarks

The same as AsObjectArrays(IDataReader), with the names. A DictionaryRow holds the row's values; the column names are shared by every row of the result set. Use ToDictionary() for a copy the caller owns.

Exceptions

ArgumentNullException

reader is null.

AsDictionaryRows(DataTable)

Reads each row of a table without a model, as a DictionaryRow (the values and the column names).

public static MappedTable<DictionaryRow> AsDictionaryRows(this DataTable table)

Parameters

table DataTable

The table to read.

Returns

MappedTable<DictionaryRow>

The deferred view; nothing runs until a terminal does.

Remarks

The same as AsObjectArrays(DataTable), with the names. A DictionaryRow holds the row's values; the column names are shared by every row of the result set. Use ToDictionary() for a copy the caller owns.

Exceptions

ArgumentNullException

table is null.