CustomValidationAttribute(Type, String) 建構函式

定義

初始化 CustomValidationAttribute 類別的新執行個體。Initializes a new instance of the CustomValidationAttribute class.

public:
 CustomValidationAttribute(Type ^ validatorType, System::String ^ method);
public CustomValidationAttribute (Type validatorType, string method);
new System.ComponentModel.DataAnnotations.CustomValidationAttribute : Type * string -> System.ComponentModel.DataAnnotations.CustomValidationAttribute
Public Sub New (validatorType As Type, method As String)

參數

validatorType
Type

包含會執行自訂驗證之方法的型別。The type that contains the method that performs custom validation.

method
String

執行自訂驗證的方法。The method that performs custom validation.

備註

這個方法會指定要在執行時間呼叫的自訂類別和相關的方法,以便執行自訂驗證邏輯。This method specifies a custom class and a related method to call at run time in order to execute custom validation logic.

適用於