ValidationResult 類別

定義

代表驗證要求結果的容器。Represents a container for the results of a validation request.

public ref class ValidationResult
public class ValidationResult
type ValidationResult = class
Public Class ValidationResult
繼承
ValidationResult

建構函式

ValidationResult(String)

使用錯誤訊息,初始化 ValidationResult 類別的新執行個體。Initializes a new instance of the ValidationResult class by using an error message.

ValidationResult(String, IEnumerable<String>)

使用錯誤訊息以及有驗證錯誤的成員清單,初始化 ValidationResult 類別的新執行個體。Initializes a new instance of the ValidationResult class by using an error message and a list of members that have validation errors.

ValidationResult(ValidationResult)

使用 ValidationResult 物件,初始化 ValidationResult 類別的新執行個體。Initializes a new instance of the ValidationResult class by using a ValidationResult object.

欄位

Success

表示驗證成功 (若驗證成功則為 true,否則為 false)。Represents the success of the validation (true if validation was successful; otherwise, false).

屬性

ErrorMessage

取得驗證的錯誤訊息。Gets the error message for the validation.

MemberNames

取得成員名稱集合,這些成員表示哪些欄位有驗證錯誤。Gets the collection of member names that indicate which fields have validation errors.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回目前驗證結果的字串表示。Returns a string representation of the current validation result.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於