DataAnnotationsModelValidatorProvider.RegisterValidatableObjectAdapter Method (Type, Type)
.NET Framework (current version)
Registers an adapter for object validation.
Assembly: System.Web (in System.Web.dll)
Public Shared Sub RegisterValidatableObjectAdapter ( modelType As Type, adapterType As Type )
Parameters
- modelType
-
Type:
System.Type
The type of the model.
- adapterType
-
Type:
System.Type
The type of the adapter.
| Exception | Condition |
|---|---|
| ArgumentNullException | The adapterType parameter is null. |
| ArgumentException | The model type does not implement the IValidatableObject interface. |
| ArgumentException | The adapter type does not implement ModelValidator. |
| ArgumentException | The adapter type does not have a public constructor that accepts two parameters that are typed ModelMetadata and ModelBindingExecutionContext. |
.NET Framework
Available since 4.5
Available since 4.5
Show: