共用方式為


ReferenceCollectionBuilder.IsRequired(Boolean) 方法

定義

設定這是否為必要關聯性 (,亦即是否可以) 指派 null 外鍵屬性 () 。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder IsRequired (bool required = true);
abstract member IsRequired : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder
override this.IsRequired : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder
Public Overridable Function IsRequired (Optional required As Boolean = true) As ReferenceCollectionBuilder

參數

required
Boolean

值,指出這是否為必要關聯性。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

適用於