Share via


DataAnnotationsModelValidatorProvider.RegisterDefaultValidatableObjectAdapter Method

Registers the default adapter type for objects which 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 RegisterDefaultValidatableObjectAdapter ( _
    adapterType As Type _
)
'Usage
Dim instance As DataAnnotationsModelValidatorProvider
Dim adapterType As Type

instance.RegisterDefaultValidatableObjectAdapter(adapterType)
public void RegisterDefaultValidatableObjectAdapter(
    Type adapterType
)
public:
void RegisterDefaultValidatableObjectAdapter(
    Type^ adapterType
)
member RegisterDefaultValidatableObjectAdapter : 
        adapterType:Type -> unit 
public function RegisterDefaultValidatableObjectAdapter(
    adapterType : Type
)

Parameters

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

See Also

Reference

DataAnnotationsModelValidatorProvider Class

System.Web.Http.Validation.Providers Namespace