Class AdbMySqlClientTypeMapper
Stores mappings between .NET types and database types for the MySql.Data.MySqlClient MySQL™ or MariaDB™ provider, and allows setting the database type of database parameters from these mappings.
See the Data Type Mappings, as well as AdbTypeMapper and predefined type mappings for further details.
This class can be derived from to create a customized provider that revises and adds mappings.
This class is immutable. This avoids threading issues, since an instance is often accessed by multiple threads. Any user custom provider services should also be immutable for the same reason.
Implements
Inherited Members
Namespace: actionETL.Adb.MySqlClientExternal
Assembly: actionETL.dll
Syntax
public class AdbMySqlClientTypeMapper : AdbTypeMapper, IAdbTypeMapper
Constructors
AdbMySqlClientTypeMapper()
Initializes a new instance of the AdbMySqlClientTypeMapper class, which stores MySQL™ or MariaDB™ mappings between .NET types and database types, and allows setting the database type of database parameters from these mappings.
Declaration
public AdbMySqlClientTypeMapper()
Methods
Get()
Gets a singleton instance of AdbMySqlClientTypeMapper, which is used when instantiating a new AdbProvider for accessing a MySQL™ or MariaDB™ data source.
Declaration
public static IAdbTypeMapper Get()
Returns
| Type | Description |
|---|---|
| IAdbTypeMapper |
SetMappedType(AdbParameter, Type, AdbColumnSchema, ParameterDirection)
Set the database type of a database parameter, using previously defined mappings.
The database type can be provider-independent such as System.Data.DbType
Int32, or a provider-specific one such as
System.Data.SqlDbType UniqueIdentifier, or Untyped, which means
the provider deduces the database type for each value, e.g. for each row.
If no pre-defined mapping is found, and dotNetType is an enum or
nullable enum, and adbColumnSchema is either null or an
integral type, then the parameter is mapped to the enum underlying type.
This allows the enum to be stored in an integer column.
Declaration
public override bool SetMappedType(AdbParameter adbParameter, Type dotNetType, AdbColumnSchema adbColumnSchema, ParameterDirection direction)
Parameters
| Type | Name | Description |
|---|---|---|
| AdbParameter | adbParameter | The database parameter. Must not be |
| Type | dotNetType | The .NET CLR type ( |
| AdbColumnSchema | adbColumnSchema | The schema for the database column, or null if not available. |
| ParameterDirection | direction | The parameter direction. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|