TypeMappingConfigurationBuilder Class

Definition

Provides a simple API surface for setting property defaults before conventions run.

public class TypeMappingConfigurationBuilder
type TypeMappingConfigurationBuilder = class
Public Class TypeMappingConfigurationBuilder
Inheritance
TypeMappingConfigurationBuilder
Derived

Remarks

Instances of this class are returned from methods when using the ModelConfigurationBuilder API and it is not designed to be directly constructed in your application code.

See Modeling entity types and relationships for more information and examples.

Constructors

TypeMappingConfigurationBuilder(PropertyConfiguration)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Properties

Configuration

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Methods

HasAnnotation(String, Object)

Adds or updates an annotation on the property.

HasConversion(Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion<TConversion>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasMaxLength(Int32)

Configures the maximum length of data that can be stored in this property. Maximum length can only be set on array properties (including String properties).

HasPrecision(Int32)

Configures the precision of the property.

HasPrecision(Int32, Int32)

Configures the precision and scale of the property.

HasSentinel(Object)

Configures the value that will be used to determine if the property has been set or not. If the property is set to the sentinel value, then it is considered not set. By default, the sentinel value is the CLR default value for the type of the property.

IsUnicode(Boolean)

Configures whether the property as capable of persisting unicode characters. Can only be set on String properties.

Extension Methods

HasColumnType(TypeMappingConfigurationBuilder, String)

Configures the data type of the column that the scalar maps to when targeting a relational database. This should be the complete type name, including precision, scale, length, etc.

IsFixedLength(TypeMappingConfigurationBuilder, Boolean)

Configures the scalar as capable of storing only fixed-length data, such as strings.

Applies to