ModelMetadata.IsRequired プロパティ

定義

モデル値が必要かどうかを示す値を取得します。 これは、現在のインスタンスがプロパティを表す場合にのみ適用されます。

public:
 abstract property bool IsRequired { bool get(); };
public abstract bool IsRequired { get; }
member this.IsRequired : bool
Public MustOverride ReadOnly Property IsRequired As Boolean

プロパティ値

注釈

その場合 true 、モデル値は検証コントロールで必要と見なされます。

既定では、 が 存在しない場合は暗黙的 System.ComponentModel.DataAnnotations.RequiredAttribute な が true.追加されます。

適用対象