Table of Contents

Method AsObjectArrays

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

AsObjectArrays(IExecuteReader)

Reads each row of a query without a model, as an array of its values.

public static MappedQuery<object?[]> AsObjectArrays(this IExecuteReader command)

Parameters

command IExecuteReader

The command to read from.

Returns

MappedQuery<object[]>

The deferred query; nothing runs until a terminal does.

Remarks

Everything after it is the mapped view: the terminals, Skip and Take, SingleResult(), AsyncReads() and UsePool are the ones Map<T>() has, and a later result set is read through the same way. Each row is one new object?[] with a slot for each column (a database NULL is null). The row arrays belong to the caller; only the buffers that hold the rows are pooled, and those are cleared when they go back. The columns are read once, in order, so a provider may stream a row. The result carries no column names: use AsDictionaryRows(IExecuteReader) when you need them.

Exceptions

ArgumentNullException

command is null.

AsObjectArrays(IDbCommand)

Reads each row of a query without a model, as an array of its values.

public static MappedCommand<object?[]> AsObjectArrays(this IDbCommand command)

Parameters

command IDbCommand

The command to read from.

Returns

MappedCommand<object[]>

The deferred query; nothing runs until a terminal does.

Remarks

Everything after it is the mapped view: the terminals, Skip and Take, SingleResult(), AsyncReads() and UsePool are the ones Map<T>() has, and a later result set is read through the same way. Each row is one new object?[] with a slot for each column (a database NULL is null). The row arrays belong to the caller; only the buffers that hold the rows are pooled, and those are cleared when they go back. The columns are read once, in order, so a provider may stream a row. The result carries no column names: use AsDictionaryRows(IExecuteReader) when you need them.

Exceptions

ArgumentNullException

command is null.

AsObjectArrays(IDataReader)

Reads each row of a reader without a model, as an array of its values.

public static MappedReader<object?[]> AsObjectArrays(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<object[]>

The deferred view; nothing runs until a terminal does.

Remarks

Each row is one new object?[] with a slot for each column (a database NULL is null), and belongs to the caller. The result carries no column names: use AsDictionaryRows(IDataReader) when you need them.

Exceptions

ArgumentNullException

reader is null.

AsObjectArrays(DataTable)

Reads each row of a table without a model, as an array of its values.

public static MappedTable<object?[]> AsObjectArrays(this DataTable table)

Parameters

table DataTable

The table to read.

Returns

MappedTable<object[]>

The deferred view; nothing runs until a terminal does.

Remarks

Each row is one new object?[] with a slot for each column (a database NULL is null), and belongs to the caller. The result carries no column names: use AsDictionaryRows(DataTable) when you need them.

Exceptions

ArgumentNullException

table is null.