Class InfoValidationResult
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Represents the result of an info object validation.
public class InfoValidationResult
- Inheritance
-
objectInfoValidationResult
- 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
isValidboolA value indicating whether the validation passed or failed.
fieldNamestringName of the field which caused the validation error (if the error can be attributed to a specific field), or null.
errorMessageKeystringKey identifying a localizable error message, or null.
errorMessageParamsobject[]An array of substitution parameters for the localizable error message.
Exceptions
- ArgumentException
Thrown when
isValidis false and noerrorMessageKeyis 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
fieldNamestringName of the field which caused the validation error (if the error can be attributed to a specific field), or null.
errorMessageKeystringKey identifying a localizable error message.
errorMessageParamsobject[]An array of substitution parameters for the localizable error message.
Exceptions
- ArgumentException
Thrown when no
errorMessageKeyis 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; }