CoreTypeMapping 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 abstract class CoreTypeMapping
type CoreTypeMapping = class
Public MustInherit Class CoreTypeMapping
Inheritance
CoreTypeMapping
Derived

Remarks

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

Constructors

CoreTypeMapping(CoreTypeMapping+CoreTypeMappingParameters)

Initializes a new instance of the CoreTypeMapping class.

Properties

ClrType

Gets the .NET type used in the EF model.

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.

Converter

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

ElementTypeMapping

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

JsonValueReaderWriter

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

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.

Parameters

Returns the parameters used to create this type mapping.

ProviderValueComparer

A ValueComparer for the provider CLR type values.

StructuralComparer
Obsolete.

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

ValueGeneratorFactory
Obsolete.

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

Methods

Clone(CoreTypeMapping+CoreTypeMappingParameters)

Creates a copy of this mapping.

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

Clones the type mapping to update any parameter if needed.

Clone(ValueConverter)

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

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.

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

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

Applies to