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 中的验证特征是否是 RequiredAttribute 特征)。 (继承自 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) |