共用方式為


ComplexTypePropertyBuilder<TProperty>.IsRequired(Boolean) 方法

定義

設定這個屬性是否必須指派值,或者 null 是否為有效的值。 只有在屬性是以可指派 null 的 CLR 類型為基礎時,才能將屬性設定為非必要。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<TProperty> IsRequired (bool required = true);
override this.IsRequired : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<'Property>
Public Overridable Function IsRequired (Optional required As Boolean = true) As ComplexTypePropertyBuilder(Of TProperty)

參數

required
Boolean

值,指出是否需要 屬性。

傳回

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

適用於