共用方式為


IConventionForeignKeyBuilder.HasForeignKey 方法

定義

多載

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

設定要當做這個關聯性外鍵的屬性。

HasForeignKey(IReadOnlyList<String>, Boolean)

設定要當做這個關聯性外鍵的屬性。

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

設定要當做這個關聯性外鍵的屬性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? 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.IConventionForeignKeyBuilder
Public Function HasForeignKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

參數

properties
IReadOnlyList<IConventionProperty>

要當做這個關聯性外鍵的屬性。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

如果屬性設定為外鍵,則為相同的產生器實例, null 否則為 。

適用於

HasForeignKey(IReadOnlyList<String>, Boolean)

設定要當做這個關聯性外鍵的屬性。

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

參數

propertyNames
IReadOnlyList<String>

要當做這個關聯性外鍵的屬性。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

如果屬性設定為外鍵,則為相同的產生器實例, null 否則為 。

適用於