共用方式為


PropertiesConfigurationBuilder Class

Definition

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

public class PropertiesConfigurationBuilder
type PropertiesConfigurationBuilder = class
Public Class PropertiesConfigurationBuilder
Inheritance
PropertiesConfigurationBuilder
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.

Constructors

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

AreUnicode(Boolean)

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

HaveAnnotation(String, Object)

Adds or updates an annotation on the property.

HaveConversion(Type, Type, Type)

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

HaveConversion(Type, Type)

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

HaveConversion(Type)

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

HaveConversion<TConversion,TComparer,TProviderComparer>()

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

HaveConversion<TConversion,TComparer>()

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

HaveConversion<TConversion>()

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

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

HavePrecision(Int32, Int32)

Configures the precision and scale of the property.

HavePrecision(Int32)

Configures the precision of the property.

HaveSentinel(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.

Extension Methods

AreFixedLength(PropertiesConfigurationBuilder, Boolean)

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

HaveColumnType(PropertiesConfigurationBuilder, String)

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

UseCollation(PropertiesConfigurationBuilder, String)

Configures the property to use the given collation. The database column will be created with the given collation, and it will be used implicitly in all collation-sensitive operations.

Applies to