Table of Contents

Class InfoValidationResult

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Represents the result of an info object validation.

public class InfoValidationResult
Inheritance
object
InfoValidationResult
Extension Methods

Constructors

InfoValidationResult(bool, string, string, params object[])

Initializes a new instance of the InfoValidationResult class.

public InfoValidationResult(bool isValid, string fieldName, string errorMessageKey, params object[] errorMessageParams)

Parameters

isValid bool

A value indicating whether the validation passed or failed.

fieldName string

Name of the field which caused the validation error (if the error can be attributed to a specific field), or null.

errorMessageKey string

Key identifying a localizable error message, or null.

errorMessageParams object[]

An array of substitution parameters for the localizable error message.

Exceptions

ArgumentException

Thrown when isValid is false and no errorMessageKey is provided.

InfoValidationResult(string, string, params object[])

Initializes a new instance of the InfoValidationResult class with IsValid state set to false using the provided error details.

public InfoValidationResult(string fieldName, string errorMessageKey, params object[] errorMessageParams)

Parameters

fieldName string

Name of the field which caused the validation error (if the error can be attributed to a specific field), or null.

errorMessageKey string

Key identifying a localizable error message.

errorMessageParams object[]

An array of substitution parameters for the localizable error message.

Exceptions

ArgumentException

Thrown when no errorMessageKey is provided.

Properties

ErrorMessageKey

Key identifying a localizable error message, or null.

public string ErrorMessageKey { get; }

Property Value

string

ErrorMessageParams

An array of parameters for the localizable error message.

public object[] ErrorMessageParams { get; }

Property Value

object[]

FieldName

Name of the field which caused the validation error, or null.

public string FieldName { get; }

Property Value

string

Remarks

Some validation errors are the result of a combination of field values and cannot be attributed to one specific field.

IsValid

A value indicating whether the validation passed or failed.

public bool IsValid { get; }

Property Value

bool

Success

Validation result with IsValid flag set to true and no validation error message.

public static InfoValidationResult Success { get; }

Property Value

InfoValidationResult