RelationalTypeMapping RelationalTypeMapping Class

Represents the mapping between a .NET type and a database type.

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

Syntax

Declaration

public class RelationalTypeMappingPublic Class RelationalTypeMapping

Inheritance Hierarchy

  • System.Object
    System.Object
  • RelationalTypeMapping
    RelationalTypeMapping

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()

Constructors summary

Initializes a new instance of the RelationalTypeMapping class.

Initializes a new instance of the RelationalTypeMapping class.

Initializes a new instance of the RelationalTypeMapping class.

Fields summary

Gets the mapping to be used when the only piece of information is that there is a null value.

Properties summary

Gets the .NET type.

Gets the System.Data.DbType to be used.

Gets a value indicating whether the size setting has been manually configured to a non-default value.

Gets a value indicating whether the Unicode setting has been manually configured to a non-default value.

Gets a value indicating whether the type should handle Unicode data or not.

Gets the size of data the property is configured to store, or null if no size is configured.

Gets the name of the database type.

Methods summary

Configures type information of a System.Data.Common.DbParameter.

Creates a copy of this mapping.

Creates a System.Data.Common.DbParameter with the appropriate type information configured.

Constructors

  • RelationalTypeMapping(String, Type)
    RelationalTypeMapping(String, Type)

    Initializes a new instance of the RelationalTypeMapping class.

    public RelationalTypeMapping(string storeType, Type clrType)Public Sub New(storeType As String, clrType As Type)

    Parameters

    • storeType
      System.String
      System.String

      The name of the database type.

    • clrType
      System.Type
      System.Type

      The .NET type.

  • RelationalTypeMapping(String, Type, Nullable<DbType>)
    RelationalTypeMapping(String, Type, Nullable(Of DbType))

    Initializes a new instance of the RelationalTypeMapping class.

    public RelationalTypeMapping(string storeType, Type clrType, DbType? dbType)Public Sub New(storeType As String, clrType As Type, dbType As DbType?)

    Parameters

    • storeType
      System.String
      System.String

      The name of the database type.

    • clrType
      System.Type
      System.Type

      The .NET type.

    • dbType
      System.Nullable<T><System.Data.DbType>
      System.Nullable<T>(Of System.Data.DbType)

      The System.Data.DbType to be used.

  • RelationalTypeMapping(String, Type, Nullable<DbType>, Boolean, Nullable<Int32>, Boolean, Boolean)
    RelationalTypeMapping(String, Type, Nullable(Of DbType), Boolean, Nullable(Of Int32), Boolean, Boolean)

    Initializes a new instance of the RelationalTypeMapping class.

    public RelationalTypeMapping(string storeType, Type clrType, DbType? dbType, bool unicode, int ? size, bool hasNonDefaultUnicode = false, bool hasNonDefaultSize = false)Public Sub New(storeType As String, clrType As Type, dbType As DbType?, unicode As Boolean, size As Integer?, hasNonDefaultUnicode As Boolean = False, hasNonDefaultSize As Boolean = False)

    Parameters

    • storeType
      System.String
      System.String

      The name of the database type.

    • clrType
      System.Type
      System.Type

      The .NET type.

    • dbType
      System.Nullable<T><System.Data.DbType>
      System.Nullable<T>(Of System.Data.DbType)

      The System.Data.DbType to be used.

    • unicode
      System.Boolean
      System.Boolean

      A value indicating whether the type should handle Unicode data or not.

    • size
      System.Nullable<T><System.Int32>
      System.Nullable<T>(Of System.Int32)

      The size of data the property is configured to store, or null if no size is configured.

    • hasNonDefaultUnicode
      System.Boolean
      System.Boolean

      A value indicating whether the Unicode setting has been manually configured to a non-default value.

    • hasNonDefaultSize
      System.Boolean
      System.Boolean

      A value indicating whether the size setting has been manually configured to a non-default value.

Fields

  • NullMapping
    NullMapping

    Gets the mapping to be used when the only piece of information is that there is a null value.

    public static readonly RelationalTypeMapping NullMappingPublic Shared ReadOnly NullMapping As RelationalTypeMapping

Properties

  • ClrType
    ClrType

    Gets the .NET type.

    public virtual Type ClrType { get; }Public Overridable ReadOnly Property ClrType As Type

    Property Value

    • System.Type
      System.Type
  • DbType
    DbType

    Gets the System.Data.DbType to be used.

    public virtual DbType? DbType { get; }Public Overridable ReadOnly Property DbType As DbType?

    Property Value

    • System.Nullable<T><System.Data.DbType>
      System.Nullable<T>(Of System.Data.DbType)
  • HasNonDefaultSize
    HasNonDefaultSize

    Gets a value indicating whether the size setting has been manually configured to a non-default value.

    public virtual bool HasNonDefaultSize { get; }Public Overridable ReadOnly Property HasNonDefaultSize As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • HasNonDefaultUnicode
    HasNonDefaultUnicode

    Gets a value indicating whether the Unicode setting has been manually configured to a non-default value.

    public virtual bool HasNonDefaultUnicode { get; }Public Overridable ReadOnly Property HasNonDefaultUnicode As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • IsUnicode
    IsUnicode

    Gets a value indicating whether the type should handle Unicode data or not.

    public virtual bool IsUnicode { get; }Public Overridable ReadOnly Property IsUnicode As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • Size
    Size

    Gets the size of data the property is configured to store, or null if no size is configured.

    public virtual int ? Size { get; }Public Overridable ReadOnly Property Size As Integer?

    Property Value

    • System.Nullable<T><System.Int32>
      System.Nullable<T>(Of System.Int32)
  • StoreType
    StoreType

    Gets the name of the database type.

    public virtual string StoreType { get; }Public Overridable ReadOnly Property StoreType As String

    Property Value

    • System.String
      System.String

Methods

  • ConfigureParameter(DbParameter)
    ConfigureParameter(DbParameter)

    Configures type information of a System.Data.Common.DbParameter.

    protected virtual void ConfigureParameter(DbParameter parameter)Protected Overridable Sub ConfigureParameter(parameter As DbParameter)

    Parameters

    • parameter
      System.Data.Common.DbParameter
      System.Data.Common.DbParameter

      The parameter to be configured.

  • CreateCopy(String, Nullable<Int32>)
    CreateCopy(String, Nullable(Of Int32))

    Creates a copy of this mapping.

    public virtual RelationalTypeMapping CreateCopy(string storeType, int ? size)Public Overridable Function CreateCopy(storeType As String, size As Integer?) As RelationalTypeMapping

    Parameters

    • storeType
      System.String
      System.String

      The name of the database type.

    • size
      System.Nullable<T><System.Int32>
      System.Nullable<T>(Of System.Int32)

      The size of data the property is configured to store, or null if no size is configured.

    Returns

  • CreateParameter(DbCommand, String, Object, Nullable<Boolean>)
    CreateParameter(DbCommand, String, Object, Nullable(Of Boolean))

    Creates a System.Data.Common.DbParameter with the appropriate type information configured.

    public virtual DbParameter CreateParameter(DbCommand command, string name, object value, bool ? nullable = null)Public Overridable Function CreateParameter(command As DbCommand, name As String, value As Object, nullable As Boolean? = Nothing) As DbParameter

    Parameters

    • command
      System.Data.Common.DbCommand
      System.Data.Common.DbCommand

      The command the parameter should be created on.

    • name
      System.String
      System.String

      The name of the parameter.

    • value
      System.Object
      System.Object

      The value to be assigned to the parameter.

    • nullable
      System.Nullable<T><System.Boolean>
      System.Nullable<T>(Of System.Boolean)

      A value indicating whether the parameter should be a nullable type.

    Returns

    • System.Data.Common.DbParameter
      System.Data.Common.DbParameter

Details

Assembly

Microsoft.EntityFrameworkCore.Relational.dll