RelationalPropertyBuilderExtensions.HasColumnType 方法

定义

重载

HasColumnType(PropertyBuilder, String)

配置属性在面向关系数据库时映射到的列的数据类型。 这应该是完整的类型名称,包括精度、小数位数、长度等。

HasColumnType(IConventionPropertyBuilder, String, Boolean)

配置属性在面向关系数据库时映射到的列的数据类型。 这应该是完整的类型名称,包括精度、小数位数、长度等。

HasColumnType<TProperty>(PropertyBuilder<TProperty>, String)

配置属性在面向关系数据库时映射到的列的数据类型。 这应该是完整的类型名称,包括精度、小数位数、长度等。

HasColumnType(PropertyBuilder, String)

配置属性在面向关系数据库时映射到的列的数据类型。 这应该是完整的类型名称,包括精度、小数位数、长度等。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string typeName);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string? typeName);
static member HasColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
<Extension()>
Public Function HasColumnType (propertyBuilder As PropertyBuilder, typeName As String) As PropertyBuilder

参数

propertyBuilder
PropertyBuilder

要配置的属性的生成器。

typeName
String

列的数据类型的名称。

返回

同一生成器实例,以便可以链接多个调用。

注解

有关详细信息和示例,请参阅 为实体类型和关系建模

适用于

HasColumnType(IConventionPropertyBuilder, String, Boolean)

配置属性在面向关系数据库时映射到的列的数据类型。 这应该是完整的类型名称,包括精度、小数位数、长度等。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string typeName, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? typeName, bool fromDataAnnotation = false);
static member HasColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function HasColumnType (propertyBuilder As IConventionPropertyBuilder, typeName As String, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

参数

propertyBuilder
IConventionPropertyBuilder

要配置的属性的生成器。

typeName
String

列的数据类型的名称。

fromDataAnnotation
Boolean

指示配置是否是使用数据注释指定的。

返回

如果应用了配置,则为同一生成器实例, null 否则为 。

注解

有关详细信息和示例,请参阅 为实体类型和关系建模

适用于

HasColumnType<TProperty>(PropertyBuilder<TProperty>, String)

配置属性在面向关系数据库时映射到的列的数据类型。 这应该是完整的类型名称,包括精度、小数位数、长度等。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasColumnType<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string typeName);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasColumnType<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string? typeName);
static member HasColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
<Extension()>
Public Function HasColumnType(Of TProperty) (propertyBuilder As PropertyBuilder(Of TProperty), typeName As String) As PropertyBuilder(Of TProperty)

类型参数

TProperty

要配置的属性的类型。

参数

propertyBuilder
PropertyBuilder<TProperty>

要配置的属性的生成器。

typeName
String

列的数据类型的名称。

返回

同一生成器实例,以便可以链接多个调用。

注解

有关详细信息和示例,请参阅 为实体类型和关系建模

适用于