共用方式為


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 如果可以切換主體和相依實體類型,或關聯性可以移至其中一個參與實體類型的基底類型。

適用於