MutableEntityTypeExtensions.GetOrAddForeignKey メソッド

定義

オーバーロード

GetOrAddForeignKey(IMutableEntityType, IMutableProperty, IMutableKey, IMutableEntityType)

既存のリレーションシップを取得するか、まだ定義されていない場合は新しいリレーションシップを作成します。

GetOrAddForeignKey(IMutableEntityType, IReadOnlyList<IMutableProperty>, IMutableKey, IMutableEntityType)

既存のリレーションシップを取得するか、まだ定義されていない場合は新しいリレーションシップを作成します。

GetOrAddForeignKey(IMutableEntityType, IMutableProperty, IMutableKey, IMutableEntityType)

既存のリレーションシップを取得するか、まだ定義されていない場合は新しいリレーションシップを作成します。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey GetOrAddForeignKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, Microsoft.EntityFrameworkCore.Metadata.IMutableKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType principalEntityType);
static member GetOrAddForeignKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * Microsoft.EntityFrameworkCore.Metadata.IMutableProperty * Microsoft.EntityFrameworkCore.Metadata.IMutableKey * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
<Extension()>
Public Function GetOrAddForeignKey (entityType As IMutableEntityType, property As IMutableProperty, principalKey As IMutableKey, principalEntityType As IMutableEntityType) As IMutableForeignKey

パラメーター

entityType
IMutableEntityType

外部キーを取得または追加するエンティティ型。

property
IMutableProperty

外部キーが定義されているプロパティ。

principalKey
IMutableKey

参照される主キーまたは代替キー。

principalEntityType
IMutableEntityType

リレーションシップのターゲットであるエンティティ型。 これは、リレーションシップが principalKey 継承階層の派生型を対象とする場合に定義される型とは異なる場合があります (キーは階層の基本型で定義されているため)。

戻り値

既存または新しく作成された外部キー。

適用対象

GetOrAddForeignKey(IMutableEntityType, IReadOnlyList<IMutableProperty>, IMutableKey, IMutableEntityType)

既存のリレーションシップを取得するか、まだ定義されていない場合は新しいリレーションシップを作成します。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey GetOrAddForeignKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IMutableKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType principalEntityType);
static member GetOrAddForeignKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> * Microsoft.EntityFrameworkCore.Metadata.IMutableKey * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
<Extension()>
Public Function GetOrAddForeignKey (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty), principalKey As IMutableKey, principalEntityType As IMutableEntityType) As IMutableForeignKey

パラメーター

entityType
IMutableEntityType

外部キーを取得または追加するエンティティ型。

properties
IReadOnlyList<IMutableProperty>

外部キーが定義されているプロパティ。

principalKey
IMutableKey

参照される主キーまたは代替キー。

principalEntityType
IMutableEntityType

リレーションシップのターゲットであるエンティティ型。 これは、リレーションシップが principalKey 継承階層の派生型を対象とする場合に定義される型とは異なる場合があります (キーは階層の基本型で定義されているため)。

戻り値

既存または新しく作成された外部キー。

適用対象