RelationalPropertyBuilderExtensions.HasColumnName 方法

定义

重载

HasColumnName(IConventionPropertyBuilder, String, StoreObjectIdentifier, Boolean)

配置属性映射到特定类似表的存储对象中的列。

HasColumnName(PropertyBuilder, String)

配置属性在面向关系数据库时映射到的列。

HasColumnName(IConventionPropertyBuilder, String, Boolean)

配置属性在面向关系数据库时映射到的列。

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

配置属性在面向关系数据库时映射到的列。

HasColumnName(IConventionPropertyBuilder, String, StoreObjectIdentifier, Boolean)

配置属性映射到特定类似表的存储对象中的列。

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

参数

propertyBuilder
IConventionPropertyBuilder

要配置的属性的生成器。

name
String

列的名称。

storeObject
StoreObjectIdentifier

存储对象的标识符。

fromDataAnnotation
Boolean

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

返回

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

注解

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

适用于

HasColumnName(PropertyBuilder, String)

配置属性在面向关系数据库时映射到的列。

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

参数

propertyBuilder
PropertyBuilder

要配置的属性的生成器。

name
String

列的名称。

返回

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

注解

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

适用于

HasColumnName(IConventionPropertyBuilder, String, Boolean)

配置属性在面向关系数据库时映射到的列。

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

参数

propertyBuilder
IConventionPropertyBuilder

要配置的属性的生成器。

name
String

列的名称。

fromDataAnnotation
Boolean

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

返回

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

注解

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

适用于

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

配置属性在面向关系数据库时映射到的列。

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

类型参数

TProperty

要配置的属性的类型。

参数

propertyBuilder
PropertyBuilder<TProperty>

要配置的属性的生成器。

name
String

列的名称。

返回

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

注解

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

适用于