IConventionSkipNavigationBuilder.CanSetForeignKey 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個值,指示是否 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 為此性質設為 。