# DataReaderMappingExtensions

Typed row projections for any forward-only DbDataReader.

Class 

`OfficeIMO.Data`

**Namespace**

`OfficeIMO.Data`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RowMapping.cs:146](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Data/RowMapping.cs#L146)

**Modifiers**

static

Typed row projections for any forward-only DbDataReader.

## Inheritance

- object
- DataReaderMappingExtensions

Filter members 

Show inherited

## Methods

RowsAs``1 3 overloads

`public static IEnumerable<T?> RowsAs<T>(DbDataReader reader)` [#](#method-rowsas-data-common-dbdatareader)

[RowMapping.cs:146](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Data/RowMapping.cs#L146)

Projects the remaining unread 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**

Returns

`IEnumerable<T?>`

`public static IEnumerable<T?> RowsAs<T>(DbDataReader reader, Action<RowMapper<T?>> configure)` [#](#method-rowsas-data-common-dbdatareader-action-officeimo-data-rowmapper)

[RowMapping.cs:157](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Data/RowMapping.cs#L157)

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 required**

**configure System.Action<OfficeIMO.Data.RowMapper<T?>> required**

Returns

`IEnumerable<T?>`

`public static IEnumerable<T?> RowsAs<T>(DbDataReader reader, Func<IDataRecord, T?> factory)` [#](#method-rowsas-data-common-dbdatareader-func-system-data-idatarecord)

[RowMapping.cs:172](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Data/RowMapping.cs#L172)

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 required**

Reader positioned before the first row to project.

**factory System.Func<System.Data.IDataRecord, T?> required**

Creates one model instance from the current row.

Returns

`IEnumerable<T?>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:465A0DA82B0C695CCA7E71E9C14D108BAD40923EFFDAEA9992F189C88A6C4F29 -->
