DataAnnotationsModelValidatorProvider 类

定义

实现 ASP.NET MVC 的默认验证提供程序。

public class DataAnnotationsModelValidatorProvider : System.Web.Mvc.AssociatedValidatorProvider
type DataAnnotationsModelValidatorProvider = class
    inherit AssociatedValidatorProvider
Public Class DataAnnotationsModelValidatorProvider
Inherits AssociatedValidatorProvider
继承
DataAnnotationsModelValidatorProvider

构造函数

DataAnnotationsModelValidatorProvider()

初始化 DataAnnotationsModelValidatorProvider 类的新实例。

属性

AddImplicitRequiredAttributeForValueTypes

获取或设置一个值,该值指示是否需要不可以为 null 的值类型。

方法

GetTypeDescriptor(Type)

获取指定类型的类型说明符。

(继承自 AssociatedValidatorProvider)
GetValidators(ModelMetadata, ControllerContext)

使用元数据和控制器上下文来获取模型的验证程序。

(继承自 AssociatedValidatorProvider)
GetValidators(ModelMetadata, ControllerContext, IEnumerable<Attribute>)

获取验证程序的列表。

RegisterAdapter(Type, Type)

注册适配器以提供客户端验证。

RegisterAdapterFactory(Type, DataAnnotationsModelValidationFactory)

为验证提供程序注册适配器工厂。

RegisterDefaultAdapter(Type)

注册默认适配器。

RegisterDefaultAdapterFactory(DataAnnotationsModelValidationFactory)

注册默认适配器工厂。

RegisterDefaultValidatableObjectAdapter(Type)

注册适配器以提供默认对象验证。

RegisterDefaultValidatableObjectAdapterFactory(DataAnnotationsValidatableObjectAdapterFactory)

为默认对象验证提供程序注册适配器工厂。

RegisterValidatableObjectAdapter(Type, Type)

注册适配器以提供对象验证。

RegisterValidatableObjectAdapterFactory(Type, DataAnnotationsValidatableObjectAdapterFactory)

为对象验证提供程序注册适配器工厂。

适用于