Skip to content

Izayoi.Data.DbDataMapper

IzayoiJiichan edited this page Sep 7, 2024 · 9 revisions

DbDataMapper

Definition

Namespace Izayoi.Data
Assembly Izayoi.Data.DbDataMapper.dll

Represents a DB data mapper.

public class DbDataMapper : IDbDataMapper

Inheritance

Object -> DbDataMapper

Constructors

Name Summary
DbDataMapper() Initializes an instance of the DbDataMapper class.
DbDataMapper(DbDataMapperOption option) Initializes an instance of the DbDataMapper class with the specified option.

Properties

Gets the DB data mapper option.

Methods

Name Returns Summary
ReadToObjectAsync<T>(DbDataReader dbDataReader, CancellationToken cancellationToken) Task<T?> Gets the first record from the DB data reader's record set, sets the values ​​for the specified T class, and returns it.
ReadToObjectsAsync<T>(DbDataReader dbDataReader, CancellationToken cancellationToken) Task<List<T>> Gets the records from the DB data reader's record set, sets the values ​​for the specified T class, and returns it.
ExecuteQueryAsync<T>(DbCommand dbCommand, CancellationToken cancellationToken) Task<List<T>> Executes a DB command and returns the record set in an object.
SelectAllAsync<T>(DbCommand dbCommand, CancellationToken cancellationToken) Task<List<T>> Executes a SELECT query and returns the record set in an object.
GetColumnNameMapper(Type objectType) PropertyMapper Gets the column name mapper of the specified object type.
GetSchemaAndTable(Type objectType) (string schemaName, string tableName) Gets the schema and table name of the specified object type.
GetSchemaName(Type objectType) string Gets the schema name of the specified object type.
GetTableName(Type objectType) string Gets the table name of the specified object type.
SetTableName(Type objectType, string tableName) void Sets the table name for the specified object type in the cache.
SetTableAndSchema(Type objectType, string tableName, string schemaName) void Sets the table and schema name for the specified object type in the cache.

Remarks

Reuse a DbDataMapper object whenever possible.

Examples

Example.DbDataMapper

Applies to

Product Versions
.NET 8
Clone this wiki locally