Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

DataReaderAsyncMappingExtensions

OfficeIMO.Data

Namespace
OfficeIMO.Data
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
static

Asynchronous typed row projections for forward-only data readers.

Inheritance

  • object
  • DataReaderAsyncMappingExtensions

Methods

RowsAsAsync``1 3 overloads
public static IAsyncEnumerable<T?> RowsAsAsync<T>(DbDataReader reader, CancellationToken cancellationToken = default) #

Asynchronously projects remaining rows by matching column names to public properties and their constructor parameters. The caller retains ownership of the reader.

Type Parameters

T

Parameters

reader System.Data.Common.DbDataReader required
cancellationToken System.Threading.CancellationToken = default optional

Returns

IAsyncEnumerable<T?>
public static IAsyncEnumerable<T?> RowsAsAsync<T>(DbDataReader reader, Action<RowMapper<T?>> configure, CancellationToken cancellationToken = default) #

Asynchronously projects remaining rows using explicit, AOT-safe column assignments. The caller retains ownership of the reader.

Type Parameters

T

Parameters

reader System.Data.Common.DbDataReader required
configure System.Action<OfficeIMO.Data.RowMapper<T?>> required
cancellationToken System.Threading.CancellationToken = default optional

Returns

IAsyncEnumerable<T?>
public static IAsyncEnumerable<T?> RowsAsAsync<T>(DbDataReader reader, Func<IDataRecord, T?> factory, CancellationToken cancellationToken = default) #

Asynchronously projects remaining rows with a caller-supplied factory. The caller retains ownership of the reader.

Type Parameters

T

Parameters

reader System.Data.Common.DbDataReader required
factory System.Func<System.Data.IDataRecord, T?> required
cancellationToken System.Threading.CancellationToken = default optional

Returns

IAsyncEnumerable<T?>