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 否则为 。

适用于