StringLengthAttributeAdapter 类

定义

为属性提供适配器 StringLengthAttribute

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

构造函数

名称 说明
StringLengthAttributeAdapter(ModelMetadata, ModelBindingExecutionContext, StringLengthAttribute)

初始化 StringLengthAttributeAdapter 类的新实例。

属性

名称 说明
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)

适用于