DataAnnotationsModelValidatorProvider.RegisterValidatableObjectAdapter Method
Registers an adapter type for the given modelType, which must implement IValidatableObject. The adapter type must derive from ModelValidator and it must contain a public constructor which takes two parameters of types ModelMetadata and HttpActionContext.
Namespace: System.Web.Http.Validation.Providers
Assembly: System.Web.Http (in System.Web.Http.dll)
Syntax
'Declaration
Public Sub RegisterValidatableObjectAdapter ( _
modelType As Type, _
adapterType As Type _
)
'Usage
Dim instance As DataAnnotationsModelValidatorProvider
Dim modelType As Type
Dim adapterType As Type
instance.RegisterValidatableObjectAdapter(modelType, _
adapterType)
public void RegisterValidatableObjectAdapter(
Type modelType,
Type adapterType
)
public:
void RegisterValidatableObjectAdapter(
Type^ modelType,
Type^ adapterType
)
member RegisterValidatableObjectAdapter :
modelType:Type *
adapterType:Type -> unit
public function RegisterValidatableObjectAdapter(
modelType : Type,
adapterType : Type
)
Parameters
- modelType
Type: System.Type
The model type.
- adapterType
Type: System.Type
The type of the adapter.