DataAnnotationsModelValidatorProvider.RegisterDefaultValidatableObjectAdapter 方法

定義

註冊一個介面卡以進行預設物件驗證。

public:
 static void RegisterDefaultValidatableObjectAdapter(Type ^ adapterType);
public static void RegisterDefaultValidatableObjectAdapter(Type adapterType);
static member RegisterDefaultValidatableObjectAdapter : Type -> unit
Public Shared Sub RegisterDefaultValidatableObjectAdapter (adapterType As Type)

參數

adapterType
Type

轉接器的種類。

例外狀況

參數 typenull

轉接器類型並非源自 ModelValidator

-或-

該介面卡類型沒有公用建構子,該建構子接受兩個參數,該參數型別為 ModelMetadataModelBindingExecutionContext和 。

適用於