RegularExpressionAttributeAdapter 类

定义

RegularExpressionAttribute 特性提供适配器。Provides an adapter for the RegularExpressionAttribute attribute.

public ref class RegularExpressionAttributeAdapter sealed : System::Web::ModelBinding::DataAnnotationsModelValidator<System::ComponentModel::DataAnnotations::RegularExpressionAttribute ^>
public sealed class RegularExpressionAttributeAdapter : System.Web.ModelBinding.DataAnnotationsModelValidator<System.ComponentModel.DataAnnotations.RegularExpressionAttribute>
type RegularExpressionAttributeAdapter = class
    inherit DataAnnotationsModelValidator<RegularExpressionAttribute>
Public NotInheritable Class RegularExpressionAttributeAdapter
Inherits DataAnnotationsModelValidator(Of RegularExpressionAttribute)
继承

构造函数

RegularExpressionAttributeAdapter(ModelMetadata, ModelBindingExecutionContext, RegularExpressionAttribute)

初始化 RegularExpressionAttributeAdapter 类的新实例。Initializes a new instance of the RegularExpressionAttributeAdapter class.

属性

Attribute

获取验证特性。Gets the validation attribute.

(继承自 DataAnnotationsModelValidator<TAttribute>)
ErrorMessage

获取验证失败的错误消息。Gets the error message for a validation failure.

(继承自 DataAnnotationsModelValidator)
IsRequired

获取指示模型是否被请求的值(即 Attribute 中的验证特征是否是 RequiredAttribute 特征)。Gets a value that indicates whether the model is required (that is, whether the validation attribute in the Attribute property is a RequiredAttribute attribute).

(继承自 DataAnnotationsModelValidator)
Metadata

在派生类中实现时,将获取模型验证程序的元数据。When implemented in a derived class, gets the metadata for the model validator.

(继承自 ModelValidator)
ModelBindingExecutionContext

在派生类中实现时,获取或设置执行上下文。When implemented in a derived class, gets the execution context.

(继承自 ModelValidator)

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetLocalizedErrorMessage(String)

获取模型的已本地化错误消息。Gets a localized error message for the model.

(继承自 DataAnnotationsModelValidator)
GetLocalizedString(String, Object[])

获取特定字符串的已本地化版本。Gets a localized version for a specific string.

(继承自 DataAnnotationsModelValidator)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Validate(Object)

返回模型的验证错误消息的列表。Returns a list of validation error messages for the model.

(继承自 DataAnnotationsModelValidator)

适用于