次の方法で共有


IConventionForeignKeyBuilder.HasEntityTypes メソッド

定義

このリレーションシップに参加するエンティティ型を構成します。 このメソッドを呼び出すことで、プリンシパル型と依存型を切り替えたり、関係を参加しているエンティティ型の 1 つの基本型に移動したりできます。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasEntityTypes (Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType principalEntityType, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType dependentEntityType, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasEntityTypes (Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType principalEntityType, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType dependentEntityType, bool fromDataAnnotation = false);
abstract member HasEntityTypes : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasEntityTypes (principalEntityType As IConventionEntityType, dependentEntityType As IConventionEntityType, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

パラメーター

principalEntityType
IConventionEntityType

設定するプリンシパル エンティティ型。

dependentEntityType
IConventionEntityType

設定する依存エンティティ型。

fromDataAnnotation
Boolean

構成がデータ注釈を使用して指定されたかどうかを示します。

戻り値

エンティティ型が関連として構成されている場合はビルダー インスタンス。 null それ以外の場合は 。

適用対象