語言

IConventionForeignKeyBuilder.IsConstrained 方法

定義

配置關係是否受限(並保證每個外鍵值皆有匹配主鍵存在)。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? IsConstrained(bool? constrained, bool fromDataAnnotation = false);
abstract member IsConstrained : Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function IsConstrained (constrained As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

參數

constrained
Nullable<Boolean>

一個表示關係是否受限的值。 null 重置為預設值。

fromDataAnnotation
Boolean

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

傳回

如果限制性被設定,則使用同一個建構者實例, null 否則。

適用於