Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    AdbTypeMapper
    AdbMySqlClientTypeMapper
    Implements
    IAdbTypeMapper
    Inherited Members
    AdbTypeMapper.AddOrUpdateDbType(String, DbType, Byte, Byte)
    AdbTypeMapper.AddOrUpdateDbType(String, DbType, Int32)
    AdbTypeMapper.AddOrUpdateDbType(String, DbType)
    AdbTypeMapper.AddOrUpdateDbTypeWithNullable(String, DbType)
    AdbTypeMapper.AddOrUpdateFunc(String, Func<AdbParameter, Type, AdbColumnSchema, ParameterDirection, Boolean>)
    AdbTypeMapper.AddOrUpdateProviderType(String, Object, Byte, Byte)
    AdbTypeMapper.AddOrUpdateProviderType(String, Object, Int32)
    AdbTypeMapper.AddOrUpdateProviderType(String, Object)
    AdbTypeMapper.AddOrUpdateUntyped(String)
    AdbTypeMapper.IsMapped(String)
    AdbTypeMapper.Remove(String)
    AdbTypeMapper.SetMappedTypeForEnum(AdbParameter, Type, AdbColumnSchema, ParameterDirection, IEnumerable<String>)
    AdbTypeMapper.SetMappedTypeEnumMySqlTypePrefixes
    AdbTypeMapper.SetMappedTypeEnumSqlClientTypePrefixes
    AdbTypeMapper.ToString()
    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 null.

    Type dotNetType

    The .NET CLR type (string, SqlDateTime, etc.) Must not be null.

    AdbColumnSchema adbColumnSchema

    The schema for the database column, or null if not available.

    ParameterDirection direction

    The parameter direction.

    Returns
    Type Description
    Boolean

    true if a mapping was found (including Untyped), otherwise false.

    Overrides
    AdbTypeMapper.SetMappedType(AdbParameter, Type, AdbColumnSchema, ParameterDirection)
    Exceptions
    Type Condition
    ArgumentException
    • providerTypeEnum is not of the correct provider type.
    • The property is not set to a valid DbType.
    ArgumentNullException
    • adbColumnSchema
    • adbParameter
    • dotNetType

    Implements

    IAdbTypeMapper

    See Also

    MySql.Data.MySqlClient provider article
    AdbTypeMapper
    IAdbTypeService
    In This Article
    Back to top Copyright © 2023 Envobi Ltd