語言

IConventionSkipNavigationBuilder.CanSetForeignKey 方法

定義

回傳一個值,指示是否 ForeignKey 能從給定的配置來源設定此導航。

public bool CanSetForeignKey(Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey? foreignKey, bool fromDataAnnotation = false);
public bool CanSetForeignKey(Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, bool fromDataAnnotation = false);
abstract member CanSetForeignKey : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey * bool -> bool
Public Function CanSetForeignKey (foreignKey As IConventionForeignKey, Optional fromDataAnnotation As Boolean = false) As Boolean

參數

foreignKey
IConventionForeignKey

外鍵。 通過 null 則不會有外鍵關聯。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

傳回

true 若 可以 ForeignKey 為此性質設為 。

適用於