Share via


RequiredAttributeAdapter 类

定义

RequiredAttributeAttribute 特性提供适配器。

public class RequiredAttributeAdapter : System.Web.Mvc.DataAnnotationsModelValidator<System.ComponentModel.DataAnnotations.RequiredAttribute>
type RequiredAttributeAdapter = class
    inherit DataAnnotationsModelValidator<RequiredAttribute>
Public Class RequiredAttributeAdapter
Inherits DataAnnotationsModelValidator(Of RequiredAttribute)
继承

构造函数

RequiredAttributeAdapter(ModelMetadata, ControllerContext, RequiredAttribute)

初始化 RequiredAttributeAttribute 类的新实例。

属性

Attribute

获取模型验证程序的验证特性。

(继承自 DataAnnotationsModelValidator<TAttribute>)
ControllerContext

获取控制器上下文。

(继承自 ModelValidator)
ErrorMessage

获取验证失败的错误消息。

(继承自 DataAnnotationsModelValidator)
IsRequired

获取一个值,该值指示是否需要模型验证。

(继承自 DataAnnotationsModelValidator)
Metadata

获取模型验证程序的元数据。

(继承自 ModelValidator)

方法

GetClientValidationRules()

获取必需值客户端验证规则列表。

Validate(Object)

返回模型的验证错误消息的列表。

(继承自 DataAnnotationsModelValidator)

适用于