Show / Hide Table of Contents

Class DatabaseReaderMapper

Provides a way to map from a IDatabaseReader to a known object type.

Inheritance
System.Object
DatabaseReaderMapper
DatabaseReaderMapper<TEntity>
Implements
IDatabaseReaderMapper
Namespace: Paradigm.ORM.Data.Mappers
Assembly: Paradigm.ORM.Data.dll
Syntax
public class DatabaseReaderMapper : object, IDatabaseReaderMapper

Constructors

| Improve this Doc View Source

DatabaseReaderMapper(IServiceProvider, IDatabaseConnector, IColumnPropertyDescriptorCollection)

Initializes a new instance of the DatabaseReaderMapper class.

Declaration
public DatabaseReaderMapper(IServiceProvider serviceProvider, IDatabaseConnector connector, IColumnPropertyDescriptorCollection descriptor)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider.

IDatabaseConnector connector

A reference to a database connector.

IColumnPropertyDescriptorCollection descriptor

A column property descriptor collection to extract mapping information.

| Improve this Doc View Source

DatabaseReaderMapper(IServiceProvider, IDatabaseConnector, Type)

Initializes a new instance of the DatabaseReaderMapper class.

Declaration
public DatabaseReaderMapper(IServiceProvider serviceProvider, IDatabaseConnector connector, Type type)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider.

IDatabaseConnector connector

A reference to a database connector.

Type type

The type containing the mapping information, or the reference to the mapping information.

| Improve this Doc View Source

DatabaseReaderMapper(IServiceProvider, IColumnPropertyDescriptorCollection)

Initializes a new instance of the DatabaseReaderMapper class.

Declaration
public DatabaseReaderMapper(IServiceProvider serviceProvider, IColumnPropertyDescriptorCollection descriptor)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider.

IColumnPropertyDescriptorCollection descriptor

A column property descriptor collection to extract mapping information.

| Improve this Doc View Source

DatabaseReaderMapper(IServiceProvider, Type)

Initializes a new instance of the DatabaseReaderMapper class.

Declaration
public DatabaseReaderMapper(IServiceProvider serviceProvider, Type type)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider.

Type type

The type containing the mapping information, or the reference to the mapping information.

| Improve this Doc View Source

DatabaseReaderMapper(IDatabaseConnector, IColumnPropertyDescriptorCollection)

Initializes a new instance of the DatabaseReaderMapper class.

Declaration
public DatabaseReaderMapper(IDatabaseConnector connector, IColumnPropertyDescriptorCollection descriptor)
Parameters
Type Name Description
IDatabaseConnector connector

A reference to a database connector.

IColumnPropertyDescriptorCollection descriptor

A column property descriptor collection to extract mapping information.

| Improve this Doc View Source

DatabaseReaderMapper(IDatabaseConnector, Type)

Initializes a new instance of the DatabaseReaderMapper class.

Declaration
public DatabaseReaderMapper(IDatabaseConnector connector, Type type)
Parameters
Type Name Description
IDatabaseConnector connector

A reference to a database connector.

Type type

The type containing the mapping information, or the reference to the mapping information.

Properties

| Improve this Doc View Source

Connector

Gets the database connector.

Declaration
protected IDatabaseConnector Connector { get; }
Property Value
Type Description
IDatabaseConnector
| Improve this Doc View Source

Descriptor

Gets the table type descriptor used to extract the mapping information.

Declaration
protected IColumnPropertyDescriptorCollection Descriptor { get; }
Property Value
Type Description
IColumnPropertyDescriptorCollection
| Improve this Doc View Source

ServiceProvider

Gets the service provider.

Declaration
protected IServiceProvider ServiceProvider { get; }
Property Value
Type Description
IServiceProvider
| Improve this Doc View Source

ValueConverter

Gets the value converter.

Declaration
protected IValueConverter ValueConverter { get; }
Property Value
Type Description
IValueConverter

Methods

| Improve this Doc View Source

CreateInstance()

Creates a new instance of the required type before mapping values.

Declaration
protected virtual object CreateInstance()
Returns
Type Description
System.Object
| Improve this Doc View Source

Map(IDatabaseReader)

Gets a list of objects mapped from a database reader.

Declaration
public List<object> Map(IDatabaseReader reader)
Parameters
Type Name Description
IDatabaseReader reader

A database reader cursor.

Returns
Type Description
List<System.Object>

A list of mapped objects.

| Improve this Doc View Source

MapAsync(IDatabaseReader)

Gets a list of objects mapped from a database reader.

Declaration
public Task<List<object>> MapAsync(IDatabaseReader reader)
Parameters
Type Name Description
IDatabaseReader reader

A database reader cursor.

Returns
Type Description
Task<List<System.Object>>

A list of mapped objects.

| Improve this Doc View Source

MapRow(IDatabaseReader)

Maps one single row from the IDatabaseReader.

Declaration
protected virtual object MapRow(IDatabaseReader reader)
Parameters
Type Name Description
IDatabaseReader reader

A database reader cursor.

Returns
Type Description
System.Object

A new instance of the known object type already mapped.

Remarks

This method do not advance the reading cursor.

| Improve this Doc View Source

MapRowAsync(IDatabaseReader)

Maps one single row from the IDatabaseReader.

Declaration
protected virtual Task<object> MapRowAsync(IDatabaseReader reader)
Parameters
Type Name Description
IDatabaseReader reader

A database reader cursor.

Returns
Type Description
Task<System.Object>

A new instance of the known object type already mapped.

Remarks

This method do not advance the reading cursor.

Implements

IDatabaseReaderMapper

Extension Methods

ObjectExtensions.ThrowIfFails<TException>(Object, Action, String)
ObjectExtensions.ThrowIfFails<TException, TResult>(Object, Func<TResult>, String)
ObjectExtensions.ThrowIfFailsAsync<TException>(Object, Func<Task>, String)
ObjectExtensions.ThrowIfFailsAsync<TException, TResult>(Object, Func<Task<TResult>>, String)

See Also

IDatabaseReaderMapper
  • Improve this Doc
  • View Source
Powered by MiracleDevs ©2017. Code licensed under the MIT License.
Documentation generated by DocFX.