共用方式為


IConventionForeignKeyBuilder.HasPrincipalKey 方法

定義

多載

HasPrincipalKey(IReadOnlyList<IConventionProperty>, Boolean)

設定這個關聯性的目標屬性。

HasPrincipalKey(IReadOnlyList<String>, Boolean)

設定這個關聯性的目標屬性。

HasPrincipalKey(IReadOnlyList<IConventionProperty>, Boolean)

設定這個關聯性的目標屬性。

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

參數

properties
IReadOnlyList<IConventionProperty>

要設為目標的這個關聯性屬性。

fromDataAnnotation
Boolean

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

傳回

如果屬性設定為此關聯性的目標,則為相同的產生器實例, null 否則為 。

適用於

HasPrincipalKey(IReadOnlyList<String>, Boolean)

設定這個關聯性的目標屬性。

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

參數

propertyNames
IReadOnlyList<String>

要設為目標的這個關聯性屬性。

fromDataAnnotation
Boolean

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

傳回

如果屬性設定為此關聯性的目標,則為相同的產生器實例, null 否則為 。

適用於