语言

IConventionRelationshipBuilder.HasForeignKey 方法

定义

重载

名称 说明
HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

配置要用作此关系的外键的属性。

HasForeignKey(IReadOnlyList<String>, Boolean)

配置要用作此关系的外键的属性。

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

配置要用作此关系的外键的属性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder HasForeignKey(System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
abstract member HasForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
Public Function HasForeignKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder

参数

properties
IReadOnlyList<IConventionProperty>

要用作此关系的外键的属性。

fromDataAnnotation
Boolean

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

返回

如果属性配置为外键,则为同一生成器实例, null 否则为外键。

适用于

HasForeignKey(IReadOnlyList<String>, Boolean)

配置要用作此关系的外键的属性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder HasForeignKey(System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member HasForeignKey : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
Public Function HasForeignKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder

参数

propertyNames
IReadOnlyList<String>

要用作此关系的外键的属性。

fromDataAnnotation
Boolean

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

返回

如果属性配置为外键,则为同一生成器实例, null 否则为外键。

适用于