DataAnnotationsModelValidatorProvider.RegisterValidatableObjectAdapter Metod

Definition

Registrerar ett kort för objektverifiering.

public:
 static void RegisterValidatableObjectAdapter(Type ^ modelType, Type ^ adapterType);
public static void RegisterValidatableObjectAdapter(Type modelType, Type adapterType);
static member RegisterValidatableObjectAdapter : Type * Type -> unit
Public Shared Sub RegisterValidatableObjectAdapter (modelType As Type, adapterType As Type)

Parametrar

modelType
Type

Typ av modell.

adapterType
Type

Typ av adapter.

Undantag

Parametern adapterType är null.

Modelltypen implementerar IValidatableObject inte gränssnittet.

-eller-

Adaptertypen implementerar ModelValidatorinte .

-eller-

Adaptertypen har ingen offentlig konstruktor som accepterar två parametrar som är inskrivna ModelMetadata och ModelBindingExecutionContext.

Gäller för