IConventionForeignKeyBuilder.CanSetEntityTypes 方法

定义

返回一个值,该值指示是否可以切换主体和依赖类型,或者是否可以将关系移动到参与实体类型之一的基类型。

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

参数

principalEntityType
IConventionEntityType

要设置的主体实体类型。

dependentEntityType
IConventionEntityType

要设置的依赖实体类型。

fromDataAnnotation
Boolean

指示是否使用数据注释指定配置。

返回

true 如果可以切换主体实体类型和依赖实体类型,或者关系可以移动到参与实体类型之一的基类型。

适用于