Table of Contents

Method EnumerateValuesFromOrdinals

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

EnumerateValuesFromOrdinals(IDataRecord, IEnumerable<int>)

Lazily enumerates the values of the columns at the specified ordinals.

public static IEnumerable<object> EnumerateValuesFromOrdinals(this IDataRecord record, IEnumerable<int> ordinals)

Parameters

record IDataRecord

The record to read the values from.

ordinals IEnumerable<int>

The ordinals to read. The values are returned in this order.

Returns

IEnumerable<object>

An enumerable of values matching the ordinals requested. The values are read from the record as the enumerable is enumerated.

Exceptions

ArgumentNullException

record or ordinals is null.

IndexOutOfRangeException

An ordinal is not a valid column index for the record. It is thrown while the result is enumerated.

EnumerateValuesFromOrdinals(IDataRecord, IReadOnlyList<int>)

Lazily enumerates the values of the columns at the specified ordinals.

public static IEnumerable<object> EnumerateValuesFromOrdinals(this IDataRecord record, IReadOnlyList<int> ordinals)

Parameters

record IDataRecord

The record to read the values from.

ordinals IReadOnlyList<int>

The ordinals to read. The values are returned in this order.

Returns

IEnumerable<object>

An enumerable of values matching the ordinals requested. The values are read from the record as the enumerable is enumerated.

Exceptions

ArgumentNullException

record or ordinals is null.

IndexOutOfRangeException

An ordinal is not a valid column index for the record. It is thrown while the result is enumerated.

EnumerateValuesFromOrdinals(IDataRecord, int, params IEnumerable<int>)

Lazily enumerates the values of the columns at the specified ordinals.

public static IEnumerable<object> EnumerateValuesFromOrdinals(this IDataRecord record, int firstOrdinal, params IEnumerable<int> remainingOrdinals)

Parameters

record IDataRecord

The record to read the values from.

firstOrdinal int

The first ordinal to read.

remainingOrdinals IEnumerable<int>

The remaining ordinals to read, in order.

Returns

IEnumerable<object>

An enumerable of values matching the ordinals requested. The values are read from the record as the enumerable is enumerated.

Exceptions

ArgumentNullException

record is null.

IndexOutOfRangeException

An ordinal is not a valid column index for the record. It is thrown while the result is enumerated.