Microsoft.AspNetCore.Mvc.DataAnnotations 命名空间

提供使用 System.ComponentModel.DataAnnotations 发现模型元数据并实现验证的类型。

类

名称 说明
AttributeAdapterBase<TAttribute>

一个抽象子类 ValidationAttributeAdapter<TAttribute> ,用于包装适配器的所有必需接口。

MvcDataAnnotationsLocalizationOptions

为 MVC 框架中的 DataAnnotations 本地化提供编程配置。

RequiredAttributeAdapter

AttributeAdapterBase<TAttribute> 表示 RequiredAttribute。

ValidationAttributeAdapter<TAttribute>

其中一个实现 IClientModelValidator 可理解数据注释属性。

ValidationAttributeAdapterProvider

为给定属性创建一个 IAttributeAdapter 。

ValidationProviderAttribute

将类型 ValidationAttribute 属性分组为一个的抽象类 Attribute

接口

名称 说明
IAttributeAdapter

接口,使适配器能够将其相关值提供给错误消息。

IValidationAttributeAdapterProvider

用于提供 IAttributeAdapter's 的提供程序。

注解

有关验证的简介, 请对模型进行验证。