DataAnnotationsModelValidator.IsRequired 屬性

定義

會得到一個值,指示模型是否被要求(即屬性中的 Attribute 驗證屬性是否為 RequiredAttribute 屬性)。

public:
 virtual property bool IsRequired { bool get(); };
public override bool IsRequired { get; }
member this.IsRequired : bool
Public Overrides ReadOnly Property IsRequired As Boolean

屬性值

true如果需要模型;否則,。 false

適用於