Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

DataReaderMappingExtensions

Namespace OfficeIMO.Data
Assembly OfficeIMO.Core
Modifiers static

Typed row projections for any forward-only DbDataReader.

Inheritance

  • Object
  • DataReaderMappingExtensions

Methods

RowsAs``1 3 overloads
public static IEnumerable<T> RowsAs<T>(DbDataReader reader) #
Returns: IEnumerable<T>

Projects the remaining unread rows by matching column names to writable public properties. The caller retains ownership of the reader.

Type Parameters

T

Parameters

reader System.Data.Common.DbDataReader requiredposition: 0
public static IEnumerable<T> RowsAs<T>(DbDataReader reader, Action<RowMapper<T>> configure) #
Returns: IEnumerable<T>

Projects the remaining unread rows using explicit column assignments. The caller retains ownership of the reader.

Type Parameters

T

Parameters

reader System.Data.Common.DbDataReader requiredposition: 0
configure System.Action{OfficeIMO.Data.RowMapper{``0}} requiredposition: 1
public static IEnumerable<T> RowsAs<T>(DbDataReader reader, Func<IDataRecord, T> factory) #
Returns: IEnumerable<T>

Projects the remaining unread rows with a caller-supplied factory. This overload supports constructor-bound and other models without a public parameterless constructor. The caller retains ownership of the reader.

Type Parameters

T

Parameters

reader System.Data.Common.DbDataReader requiredposition: 0
Reader positioned before the first row to project.
factory System.Func{System.Data.IDataRecord,``0} requiredposition: 1
Creates one model instance from the current row.