RelationalTypeMapping Class

Definition

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.

public class RelationalTypeMapping
public abstract class RelationalTypeMapping
public abstract class RelationalTypeMapping : Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping
type RelationalTypeMapping = class
type RelationalTypeMapping = class
    inherit CoreTypeMapping
Public Class RelationalTypeMapping
Public MustInherit Class RelationalTypeMapping
Public MustInherit Class RelationalTypeMapping
Inherits CoreTypeMapping
Inheritance
RelationalTypeMapping
Inheritance
RelationalTypeMapping
Derived

Remarks

See Implementation of database providers and extensions for more information and examples.

Constructors

RelationalTypeMapping(RelationalTypeMapping+RelationalTypeMappingParameters)

Initializes a new instance of the RelationalTypeMapping class.

RelationalTypeMapping(String, Type)

Initializes a new instance of the RelationalTypeMapping class.

RelationalTypeMapping(String, Type, Nullable<DbType>)

Initializes a new instance of the RelationalTypeMapping class.

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

Initializes a new instance of the RelationalTypeMapping class.

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

Initializes a new instance of the RelationalTypeMapping class.

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

Initializes a new instance of the RelationalTypeMapping class.

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

Initializes a new instance of the RelationalTypeMapping class.

Fields

NullMapping

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

Properties

ClrType

Gets the .NET type.

ClrType

Gets the .NET type used in the EF model.

(Inherited from CoreTypeMapping)
Comparer

A ValueComparer adds custom value snapshotting and comparison for CLR types that cannot be compared with Equals(Object, Object) and/or need a deep copy when taking a snapshot.

(Inherited from CoreTypeMapping)
Converter

Converts types to and from the store whenever this mapping is used. May be null if no conversion is needed.

(Inherited from CoreTypeMapping)
DbType

Gets the DbType to be used.

ElementTypeMapping

If this type mapping represents a primitive collection, this holds the element's type mapping.

(Inherited from CoreTypeMapping)
HasNonDefaultSize

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

HasNonDefaultUnicode

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

IsFixedLength

Gets a value indicating whether the type is constrained to fixed-length data.

IsUnicode

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

JsonValueReaderWriter

Handles reading and writing JSON values for instances of the mapped type.

(Inherited from CoreTypeMapping)
KeyComparer

A ValueComparer adds custom value comparison for use when comparing key values to each other. For example, when comparing a PK to and FK.

(Inherited from CoreTypeMapping)
Parameters

Returns the parameters used to create this type mapping.

Precision

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

ProviderValueComparer

A ValueComparer for the provider CLR type values.

(Inherited from CoreTypeMapping)
Scale

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

Size

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

SqlLiteralFormatString

Gets the string format to be used to generate SQL literals of this type.

StoreType

Gets the name of the database type.

StoreTypeNameBase

Gets the base name of the database type.

StoreTypePostfix

Gets the name of the database type.

StructuralComparer
Obsolete.

A ValueComparer adds custom value comparison for use when a deep/structural copy and/or comparison is needed.

(Inherited from CoreTypeMapping)
ValueGeneratorFactory
Obsolete.

An optional factory for creating a specific ValueGenerator to use with this mapping.

(Inherited from CoreTypeMapping)

Methods

Clone(CoreTypeMapping+CoreTypeMappingParameters)

Creates a copy of this mapping.

Clone(CoreTypeMapping+CoreTypeMappingParameters)

Creates a copy of this mapping.

(Inherited from CoreTypeMapping)
Clone(Nullable<Int32>, Nullable<Int32>)

Creates a copy of this mapping.

Clone(Nullable<RelationalTypeMappingInfo>, Type, ValueConverter, ValueComparer, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter, Nullable<StoreTypePostfix>)

Clones the type mapping to update any parameter if needed.

Clone(Nullable<TypeMappingInfo>, Type, ValueConverter, ValueComparer, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter)

Clones the type mapping to update any parameter if needed.

(Inherited from CoreTypeMapping)
Clone(RelationalTypeMapping+RelationalTypeMappingParameters)

Creates a copy of this mapping.

Clone(RelationalTypeMappingInfo)

Clones the type mapping to update facets from the mapping info, if needed.

Clone(String, Nullable<Int32>)

Creates a copy of this mapping.

Clone(ValueConverter)

Returns a new copy of this type mapping with the given ValueConverter added.

Clone(ValueConverter)

Returns a new copy of this type mapping with the given ValueConverter added.

(Inherited from CoreTypeMapping)
ConfigureParameter(DbParameter)

Configures type information of a DbParameter.

CreateCopy(String, Nullable<Int32>)

Creates a copy of this mapping.

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

Creates a DbParameter with the appropriate type information configured.

CreateParameter(DbCommand, String, Object, Nullable<Boolean>, ParameterDirection)

Creates a DbParameter with the appropriate type information configured.

CustomizeDataReaderExpression(Expression)

Gets a custom expression tree for reading the value from the input data reader expression that contains the database value.

GenerateCodeLiteral(Object)

Creates a an expression tree that can be used to generate code for the literal value. Currently, only very basic expressions such as constructor calls and factory methods taking simple constants are supported.

(Inherited from CoreTypeMapping)
GenerateNonNullSqlLiteral(Object)

Generates the SQL representation of a non-null literal value.

GenerateProviderValueSqlLiteral(Object)

Generates the SQL representation of a literal value without conversion.

GenerateSqlLiteral(Object)

Generates the SQL representation of a literal value.

GetDataReaderMethod()

The method to use when reading values of the given type. The method must be defined on DbDataReader or one of its subclasses.

GetDataReaderMethod(Type)

The method to use when reading values of the given type. The method must be defined on DbDataReader.

ProcessStoreType(RelationalTypeMapping+RelationalTypeMappingParameters, String, String)

Processes the store type name to add appropriate postfix/prefix text as needed.

WithComposedConverter(ValueConverter, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter)

Returns a new copy of this type mapping with the given ValueConverter added.

WithComposedConverter(ValueConverter, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter)

Returns a new copy of this type mapping with the given ValueConverter added.

(Inherited from CoreTypeMapping)
WithPrecisionAndScale(Nullable<Int32>, Nullable<Int32>)

Creates a copy of this mapping.

WithStoreTypeAndSize(String, Nullable<Int32>)

Creates a copy of this mapping.

WithTypeMappingInfo(RelationalTypeMappingInfo)

Clones the type mapping to update facets from the mapping info, if needed.

Applies to