Table of Contents

Class SqlQueryReaderRowCollection

Namespace
LfrlAnvil.Sql.Statements
Assembly
LfrlAnvil.Sql.Core.dll

Represents a collection of type-erased rows.

public sealed class SqlQueryReaderRowCollection : IReadOnlyList<SqlQueryReaderRow>, IReadOnlyCollection<SqlQueryReaderRow>, IEnumerable<SqlQueryReaderRow>, IEnumerable
Inheritance
SqlQueryReaderRowCollection
Implements
Inherited Members

Properties

Count

Gets the number of elements in the collection.

public int Count { get; }

Property Value

int

The number of elements in the collection.

Fields

Collection of definitions of associated fields.

public ReadOnlySpan<SqlResultSetField> Fields { get; }

Property Value

ReadOnlySpan<SqlResultSetField>

this[int]

Gets the element at the specified index in the read-only list.

public SqlQueryReaderRow this[int index] { get; }

Parameters

index int

The zero-based index of the element to get.

Property Value

SqlQueryReaderRow

The element at the specified index in the read-only list.

Methods

ContainsField(string)

Checks whether or not a field with the provided name exists.

[Pure]
public bool ContainsField(string fieldName)

Parameters

fieldName string

Name to check.

Returns

bool

true when field exists, otherwise false.

GetEnumerator()

Creates a new SqlQueryReaderRowCollection.Enumerator instance for this collection.

[Pure]
public SqlQueryReaderRowCollection.Enumerator GetEnumerator()

Returns

SqlQueryReaderRowCollection.Enumerator

New SqlQueryReaderRowCollection.Enumerator instance.

GetOrdinal(string)

Returns an Ordinal of a field with the provided name.

[Pure]
public int GetOrdinal(string fieldName)

Parameters

fieldName string

Field name.

Returns

int

The Ordinal of an existing field.

Exceptions

KeyNotFoundException

When field does not exist.

TryGetOrdinal(string, out int)

Attempts to return an Ordinal of a field with the provided name.

public bool TryGetOrdinal(string fieldName, out int ordinal)

Parameters

fieldName string

Field name.

ordinal int

out parameter that returns the Ordinal of an existing field.

Returns

bool

true when field exists, otherwise false.