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
this[int]
Gets the element at the specified index in the read-only list.
public SqlQueryReaderRow this[int index] { get; }
Parameters
index
intThe 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
stringName 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
GetOrdinal(string)
Returns an Ordinal of a field with the provided name.
[Pure]
public int GetOrdinal(string fieldName)
Parameters
fieldName
stringField name.
Returns
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
stringField name.
ordinal
intout parameter that returns the Ordinal of an existing field.
Returns
- bool
true when field exists, otherwise false.