Table of Contents

Method FirstOrdinalResultsAsync

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

FirstOrdinalResultsAsync(DbDataReader, bool, CancellationToken)

Reads the first column values from every record. DBNull values are converted to null.

public static ValueTask<IEnumerable<object?>> FirstOrdinalResultsAsync(this DbDataReader reader, bool useReadAsync = true, CancellationToken cancellationToken = default)

Parameters

reader DbDataReader

The IDataReader to iterate.

useReadAsync bool

If true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.

cancellationToken CancellationToken

Optional cancellation token.

Returns

ValueTask<IEnumerable<object>>

The list of values.

FirstOrdinalResultsAsync<T0>(DbDataReader, bool, CancellationToken)

Reads the first column values from every record. AnyDBNull values are then converted to null and casted to type T0;

public static ValueTask<IEnumerable<T0>> FirstOrdinalResultsAsync<T0>(this DbDataReader reader, bool useReadAsync = true, CancellationToken cancellationToken = default)

Parameters

reader DbDataReader

The IDataReader to iterate.

useReadAsync bool

If true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.

cancellationToken CancellationToken

Optional cancellation token.

Returns

ValueTask<IEnumerable<T0>>

The enumerable of casted values.

Type Parameters

T0