RequiredAttributeAdapter 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 RequiredAttribute 屬性的配接器。
public ref class RequiredAttributeAdapter sealed : System::Web::ModelBinding::DataAnnotationsModelValidator<System::ComponentModel::DataAnnotations::RequiredAttribute ^>
public sealed class RequiredAttributeAdapter : System.Web.ModelBinding.DataAnnotationsModelValidator<System.ComponentModel.DataAnnotations.RequiredAttribute>
type RequiredAttributeAdapter = class
inherit DataAnnotationsModelValidator<RequiredAttribute>
Public NotInheritable Class RequiredAttributeAdapter
Inherits DataAnnotationsModelValidator(Of RequiredAttribute)
- 繼承
-
RequiredAttributeAdapter
建構函式
| RequiredAttributeAdapter(ModelMetadata, ModelBindingExecutionContext, RequiredAttribute) |
初始化 RequiredAttributeAdapter 類別的新執行個體。 |
屬性
| Attribute |
取得驗證屬性。 (繼承來源 DataAnnotationsModelValidator<TAttribute>) |
| ErrorMessage |
取得驗證失敗的錯誤訊息。 (繼承來源 DataAnnotationsModelValidator) |
| IsRequired |
取得值,指出是否需要此模型 (也就是屬性 Attribute (Property) 中的驗證屬性 (Attribute) 是否為 RequiredAttribute 屬性 (Attribute))。 (繼承來源 DataAnnotationsModelValidator) |
| Metadata |
在衍生類別中實作時,取得模型驗證程式的中繼資料。 (繼承來源 ModelValidator) |
| ModelBindingExecutionContext |
在衍生類別中實作時,取得執行內容。 (繼承來源 ModelValidator) |
方法
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
| GetLocalizedErrorMessage(String) |
取得模型的當地語系化錯誤訊息。 (繼承來源 DataAnnotationsModelValidator) |
| GetLocalizedString(String, Object[]) |
取得特定字串的當地語系化版本。 (繼承來源 DataAnnotationsModelValidator) |
| GetType() |
取得目前執行個體的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
| ToString() |
傳回代表目前物件的字串。 (繼承來源 Object) |
| Validate(Object) |
傳回模型的驗證錯誤訊息清單。 (繼承來源 DataAnnotationsModelValidator) |