共用方式為


ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity>.IsRequired 方法

定義

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

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder<TPrincipalEntity,TDependentEntity> IsRequired (bool required = true);
override this.IsRequired : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder<'PrincipalEntity, 'DependentEntity (requires 'PrincipalEntity : null and 'DependentEntity : null)>
Public Overridable Function IsRequired (Optional required As Boolean = true) As ReferenceCollectionBuilder(Of TPrincipalEntity, TDependentEntity)

參數

required
Boolean

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

傳回

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

適用於