Table of Contents

Struct SqlQueryReaderRow

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

Represents a single type-erased row.

public readonly struct SqlQueryReaderRow
Inherited Members

Properties

Index

Specifies the 0-based position of this row in the whole collection.

public int Index { get; }

Property Value

int

Source

Source collection of rows.

public SqlQueryReaderRowCollection Source { get; }

Property Value

SqlQueryReaderRowCollection

Methods

AsSpan()

Converts this row to a ReadOnlySpan<T>.

[Pure]
public ReadOnlySpan<object?> AsSpan()

Returns

ReadOnlySpan<object>

ReadOnlySpan<T> equivalent to this row's values.

GetValue(int)

Returns a value of a field at the specified 0-based position.

[Pure]
public object? GetValue(int ordinal)

Parameters

ordinal int

Field's position.

Returns

object

Field's value.

Exceptions

IndexOutOfRangeException

When Index and ordinal combination is out of bounds.

GetValue(string)

Returns a value of a field with the provided name.

[Pure]
public object? GetValue(string fieldName)

Parameters

fieldName string

Field's name.

Returns

object

Field's value.

Exceptions

KeyNotFoundException

When field does not exist.

ToArray()

Creates a new array of values from this row.

[Pure]
public object?[] ToArray()

Returns

object[]

New array equivalent to this row's values.

ToDictionary()

Creates a new collection of (field-name, value) pairs from this row.

[Pure]
public Dictionary<string, object?> ToDictionary()

Returns

Dictionary<string, object>

New collection of (field-name, value) pairs equivalent to this row's values.