AttributeAdapterBase<TAttribute> 类

定义

的抽象子类, ValidationAttributeAdapter<TAttribute> 它封装了适配器的所有必需接口。

generic <typename TAttribute>
 where TAttribute : ValidationAttributepublic ref class AttributeAdapterBase abstract : Microsoft::AspNetCore::Mvc::DataAnnotations::ValidationAttributeAdapter<TAttribute>, Microsoft::AspNetCore::Mvc::DataAnnotations::IAttributeAdapter, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::IClientModelValidator
public abstract class AttributeAdapterBase<TAttribute> : Microsoft.AspNetCore.Mvc.DataAnnotations.ValidationAttributeAdapter<TAttribute>, Microsoft.AspNetCore.Mvc.DataAnnotations.IAttributeAdapter, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IClientModelValidator where TAttribute : ValidationAttribute
type AttributeAdapterBase<'Attribute (requires 'Attribute :> ValidationAttribute)> = class
    inherit ValidationAttributeAdapter<'Attribute (requires 'Attribute :> ValidationAttribute)>
    interface IAttributeAdapter
    interface IClientModelValidator
Public MustInherit Class AttributeAdapterBase(Of TAttribute)
Inherits ValidationAttributeAdapter(Of TAttribute)
Implements IAttributeAdapter, IClientModelValidator

类型参数

TAttribute

要包装的的类型 ValidationAttribute

继承
AttributeAdapterBase<TAttribute>
派生
实现

构造函数

AttributeAdapterBase<TAttribute>(TAttribute, IStringLocalizer)

实例化一个新的 AttributeAdapterBase<TAttribute>

属性

Attribute

获取 TAttribute 实例。

(继承自 ValidationAttributeAdapter<TAttribute>)

方法

AddValidation(ClientModelValidationContext)

调用以添加客户端模型验证。

(继承自 ValidationAttributeAdapter<TAttribute>)
GetErrorMessage(ModelMetadata, Object[])

获取使用格式化的错误消息 Attribute

(继承自 ValidationAttributeAdapter<TAttribute>)
GetErrorMessage(ModelValidationContextBase)

获取错误消息。

适用于