RelationalTypeMapper RelationalTypeMapper Class

Maps .NET types to their corresponding relational database types.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

Syntax

Declaration

public abstract class RelationalTypeMapper : IRelationalTypeMapperPublic MustInherit Class RelationalTypeMapper
    Implements IRelationalTypeMapper

Inheritance Hierarchy

  • System.Object
    System.Object
  • RelationalTypeMapper
    RelationalTypeMapper

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Properties summary

Gets the mapper to be used for byte array properties.

Gets the mapper to be used for string properties.

Methods summary

Creates the mapping for the given database type.

Gets the relational database type for the given property, using a separate type mapper if needed. This base implementation uses custom mappers for string and byte array properties. Returns null if no mapping is found.

Gets the relational database type for the given property. Returns null if no mapping is found.

Gets the mapping that represents the given database type. Returns null if no mapping is found.

Gets the relational database type for a given .NET type. Returns null if no mapping is found.

Gets the relational database type for the given byte array property.

Gets the mappings from .NET types to database types.

Gets column type for the given property.

Gets the mappings from database types to .NET types.

Gets the relational database type for the given string property.

Gets a value indicating whether the given property should use a database type that is suitable for key properties.

Ensures that the given type name is a valid type for the relational database. An exception is thrown if it is not a valid type.

Properties

  • ByteArrayMapper
    ByteArrayMapper

    Gets the mapper to be used for byte array properties.

    public virtual IByteArrayRelationalTypeMapper ByteArrayMapper { get; }Public Overridable ReadOnly Property ByteArrayMapper As IByteArrayRelationalTypeMapper

    Property Value

  • StringMapper
    StringMapper

    Gets the mapper to be used for string properties.

    public virtual IStringRelationalTypeMapper StringMapper { get; }Public Overridable ReadOnly Property StringMapper As IStringRelationalTypeMapper

    Property Value

Methods

  • CreateMappingFromStoreType(String)
    CreateMappingFromStoreType(String)

    Creates the mapping for the given database type.

    protected virtual RelationalTypeMapping CreateMappingFromStoreType(string storeType)Protected Overridable Function CreateMappingFromStoreType(storeType As String) As RelationalTypeMapping

    Parameters

    • storeType
      System.String
      System.String

      The type to create the mapping for.

    Returns

  • FindCustomMapping(IProperty)
    FindCustomMapping(IProperty)

    Gets the relational database type for the given property, using a separate type mapper if needed. This base implementation uses custom mappers for string and byte array properties. Returns null if no mapping is found.

    protected virtual RelationalTypeMapping FindCustomMapping(IProperty property)Protected Overridable Function FindCustomMapping(property As IProperty) As RelationalTypeMapping

    Parameters

    Returns

  • FindMapping(IProperty)
    FindMapping(IProperty)

    Gets the relational database type for the given property. Returns null if no mapping is found.

    public virtual RelationalTypeMapping FindMapping(IProperty property)Public Overridable Function FindMapping(property As IProperty) As RelationalTypeMapping

    Parameters

    Returns

  • FindMapping(String)
    FindMapping(String)

    Gets the mapping that represents the given database type. Returns null if no mapping is found.

    public virtual RelationalTypeMapping FindMapping(string storeType)Public Overridable Function FindMapping(storeType As String) As RelationalTypeMapping

    Parameters

    • storeType
      System.String
      System.String

      The type to get the mapping for.

    Returns

  • FindMapping(Type)
    FindMapping(Type)

    Gets the relational database type for a given .NET type. Returns null if no mapping is found.

    public virtual RelationalTypeMapping FindMapping(Type clrType)Public Overridable Function FindMapping(clrType As Type) As RelationalTypeMapping

    Parameters

    • clrType
      System.Type
      System.Type

      The type to get the mapping for.

    Returns

  • GetByteArrayMapping(IProperty)
    GetByteArrayMapping(IProperty)

    Gets the relational database type for the given byte array property.

    protected virtual RelationalTypeMapping GetByteArrayMapping(IProperty property)Protected Overridable Function GetByteArrayMapping(property As IProperty) As RelationalTypeMapping

    Parameters

    Returns

  • GetClrTypeMappings()
    GetClrTypeMappings()

    Gets the mappings from .NET types to database types.

    protected abstract IReadOnlyDictionary<Type, RelationalTypeMapping> GetClrTypeMappings()Protected MustOverride Function GetClrTypeMappings As IReadOnlyDictionary(Of Type, RelationalTypeMapping)

    Returns

    • System.Collections.Generic.IReadOnlyDictionary<TKey, TValue><System.Type, RelationalTypeMapping>
      System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>(Of System.Type, RelationalTypeMapping)

      The type mappings.

  • GetColumnType(IProperty)
    GetColumnType(IProperty)

    Gets column type for the given property.

    protected abstract string GetColumnType(IProperty property)Protected MustOverride Function GetColumnType(property As IProperty) As String

    Parameters

    Returns

    • System.String
      System.String

      The name of the database type.

  • GetStoreTypeMappings()
    GetStoreTypeMappings()

    Gets the mappings from database types to .NET types.

    protected abstract IReadOnlyDictionary<string, RelationalTypeMapping> GetStoreTypeMappings()Protected MustOverride Function GetStoreTypeMappings As IReadOnlyDictionary(Of String, RelationalTypeMapping)

    Returns

    • System.Collections.Generic.IReadOnlyDictionary<TKey, TValue><System.String, RelationalTypeMapping>
      System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>(Of System.String, RelationalTypeMapping)

      The type mappings.

  • GetStringMapping(IProperty)
    GetStringMapping(IProperty)

    Gets the relational database type for the given string property.

    protected virtual RelationalTypeMapping GetStringMapping(IProperty property)Protected Overridable Function GetStringMapping(property As IProperty) As RelationalTypeMapping

    Parameters

    Returns

  • RequiresKeyMapping(IProperty)
    RequiresKeyMapping(IProperty)

    Gets a value indicating whether the given property should use a database type that is suitable for key properties.

    protected virtual bool RequiresKeyMapping(IProperty property)Protected Overridable Function RequiresKeyMapping(property As IProperty) As Boolean

    Parameters

    Returns

    • System.Boolean
      System.Boolean

      True if the property is a key, otherwise false.

  • ValidateTypeName(String)
    ValidateTypeName(String)

    Ensures that the given type name is a valid type for the relational database. An exception is thrown if it is not a valid type.

    public virtual void ValidateTypeName(string storeType)Public Overridable Sub ValidateTypeName(storeType As String)

    Parameters

    • storeType
      System.String
      System.String

      The type to be validated.

Details

Assembly

Microsoft.EntityFrameworkCore.Relational.dll