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
commandIExecuteReaderThe 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
commandis 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
commandIDbCommandThe 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
commandis 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
readerIDataReaderThe 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
readeris 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
tableDataTableThe 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
tableis null.