Table of Contents

Class RelationalPropertiesConfigurationBuilderExtensions

Namespace
Microsoft.EntityFrameworkCore
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Relational database specific extension methods for Microsoft.EntityFrameworkCore.Metadata.Builders.PropertiesConfigurationBuilder.

public static class RelationalPropertiesConfigurationBuilderExtensions
Inheritance
RelationalPropertiesConfigurationBuilderExtensions
Inherited Members

Methods

AreFixedLength(PropertiesConfigurationBuilder, bool)

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

public static PropertiesConfigurationBuilder AreFixedLength(this PropertiesConfigurationBuilder propertyBuilder, bool fixedLength = true)

Parameters

propertyBuilder PropertiesConfigurationBuilder

The builder for the property being configured.

fixedLength bool

A value indicating whether the property is constrained to fixed length values.

Returns

PropertiesConfigurationBuilder

The same builder instance so that multiple configuration calls can be chained.

Remarks

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

AreFixedLength<TProperty>(PropertiesConfigurationBuilder<TProperty>, bool)

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

public static PropertiesConfigurationBuilder<TProperty> AreFixedLength<TProperty>(this PropertiesConfigurationBuilder<TProperty> propertyBuilder, bool fixedLength = true)

Parameters

propertyBuilder PropertiesConfigurationBuilder<TProperty>

The builder for the property being configured.

fixedLength bool

A value indicating whether the property is constrained to fixed length values.

Returns

PropertiesConfigurationBuilder<TProperty>

The same builder instance so that multiple configuration calls can be chained.

Type Parameters

TProperty

The type of the property being configured.

Remarks

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

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.

public static PropertiesConfigurationBuilder HaveColumnType(this PropertiesConfigurationBuilder propertyBuilder, string typeName)

Parameters

propertyBuilder PropertiesConfigurationBuilder

The builder for the property being configured.

typeName string

The name of the data type of the column.

Returns

PropertiesConfigurationBuilder

The same builder instance so that multiple calls can be chained.

Remarks

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

HaveColumnType<TProperty>(PropertiesConfigurationBuilder<TProperty>, 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.

public static PropertiesConfigurationBuilder<TProperty> HaveColumnType<TProperty>(this PropertiesConfigurationBuilder<TProperty> propertyBuilder, string typeName)

Parameters

propertyBuilder PropertiesConfigurationBuilder<TProperty>

The builder for the property being configured.

typeName string

The name of the data type of the column.

Returns

PropertiesConfigurationBuilder<TProperty>

The same builder instance so that multiple calls can be chained.

Type Parameters

TProperty

The type of the property being configured.

Remarks

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

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.

public static PropertiesConfigurationBuilder UseCollation(this PropertiesConfigurationBuilder propertyBuilder, string collation)

Parameters

propertyBuilder PropertiesConfigurationBuilder

The builder for the property being configured.

collation string

The collation for the column.

Returns

PropertiesConfigurationBuilder

The same builder instance so that multiple calls can be chained.

Remarks

See Database collations for more information and examples.

UseCollation<TProperty>(PropertiesConfigurationBuilder<TProperty>, 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.

public static PropertiesConfigurationBuilder<TProperty> UseCollation<TProperty>(this PropertiesConfigurationBuilder<TProperty> propertyBuilder, string collation)

Parameters

propertyBuilder PropertiesConfigurationBuilder<TProperty>

The builder for the property being configured.

collation string

The collation for the column.

Returns

PropertiesConfigurationBuilder<TProperty>

The same builder instance so that multiple calls can be chained.

Type Parameters

TProperty

Remarks

See Database collations for more information and examples.