DataAnnotationsModelValidatorProvider.RegisterValidatableObjectAdapterFactory 方法

定义

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

public:
 static void RegisterValidatableObjectAdapterFactory(Type ^ modelType, System::Web::ModelBinding::DataAnnotationsValidatableObjectAdapterFactory ^ factory);
public static void RegisterValidatableObjectAdapterFactory (Type modelType, System.Web.ModelBinding.DataAnnotationsValidatableObjectAdapterFactory factory);
static member RegisterValidatableObjectAdapterFactory : Type * System.Web.ModelBinding.DataAnnotationsValidatableObjectAdapterFactory -> unit
Public Shared Sub RegisterValidatableObjectAdapterFactory (modelType As Type, factory As DataAnnotationsValidatableObjectAdapterFactory)

参数

modelType
Type

模型的类型。

例外

factorytype 参数为 null

该模型类型未实现 IValidatableObject 接口。

适用于