Share via


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

  • adapterType
    Type: System.Type
    The type of the adapter.

See Also

Reference

DataAnnotationsModelValidatorProvider Class

System.Web.Http.Validation.Providers Namespace