TypeMappingConfigurationBuilder<TProperty> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a simple API surface for setting property defaults before conventions run.
public class TypeMappingConfigurationBuilder<TProperty> : Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
type TypeMappingConfigurationBuilder<'Property> = class
inherit TypeMappingConfigurationBuilder
Public Class TypeMappingConfigurationBuilder(Of TProperty)
Inherits TypeMappingConfigurationBuilder
Type Parameters
- TProperty
- Inheritance
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<TProperty>(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. (Inherited from TypeMappingConfigurationBuilder) |
Methods
HasAnnotation(String, Object) |
Adds or updates an annotation on the property. If an annotation with the key specified in
|
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. |
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. (Inherited from TypeMappingConfigurationBuilder) |
IsUnicode(Boolean) |
Configures 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. |
HasColumnType<TScalar>(TypeMappingConfigurationBuilder<TScalar>, 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. |
IsFixedLength<TScalar>(TypeMappingConfigurationBuilder<TScalar>, Boolean) |
Configures the scalar as capable of storing only fixed-length data, such as strings. |
Applies to
Entity Framework