共用方式為


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 否則為 。

適用於