November Happy Hour will be moved to Thursday December 5th.

Class ValidationError

Represents the base class for all validation errors.

Inheritance
System.Object
ValidationError
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.WorkflowCompatibility
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
public sealed class ValidationError

Constructors

ValidationError(String, Int32)

Initializes a new instance of the ValidationError class; initializes the error text and error numbers for this instance.

Declaration
public ValidationError(string errorText, int errorNumber)
Parameters
Type Name Description
System.String errorText

The associated error text for this instance.

System.Int32 errorNumber

The error number for this error.

ValidationError(String, Int32, Boolean)

Initializes a new instance of the ValidationError class; initializes the error text, error number and error type for this instance.

Declaration
public ValidationError(string errorText, int errorNumber, bool isWarning)
Parameters
Type Name Description
System.String errorText

The associated error text for this instance.

System.Int32 errorNumber

The error number for this error.

System.Boolean isWarning

A Boolean which is true if the error is considered a warning and false otherwise.

ValidationError(String, Int32, Boolean, String)

Initializes a new instance of the ValidationError class; initializing the error text, the error number, the error type and the property name associated with the error.

Declaration
public ValidationError(string errorText, int errorNumber, bool isWarning, string propertyName)
Parameters
Type Name Description
System.String errorText

The associated error text for this instance.

System.Int32 errorNumber

The error number for this error.

System.Boolean isWarning

A Boolean which is true if the error is considered a warning and false otherwise.

System.String propertyName

The name of the property associated with this error.

Properties

ErrorNumber

Gets the error number of this instance.

Declaration
public int ErrorNumber { get; }
Property Value
Type Description
System.Int32

ErrorText

Gets the error text for this instance.

Declaration
public string ErrorText { get; }
Property Value
Type Description
System.String

IsWarning

Gets a value that indicates whether this instance is a warning.

Declaration
public bool IsWarning { get; }
Property Value
Type Description
System.Boolean

PropertyName

Gets or sets the name of the property that failed to validate.

Declaration
public string PropertyName { get; set; }
Property Value
Type Description
System.String

UserData

Gets an System.Collections.IDictionary for the definition and storage of user-defined data related to this instance.

Declaration
public IDictionary UserData { get; }
Property Value
Type Description
System.Collections.IDictionary

Methods

GetNotSetValidationError(String)

Creates a new validation error defined for the error type of a property not being set.

Declaration
public static ValidationError GetNotSetValidationError(string propertyName)
Parameters
Type Name Description
System.String propertyName

The property associated with this error.

Returns
Type Description
ValidationError

A new validation error defined for the error type of a property not being set

ToString()

Provides a string representation of this instance incorporating the error type (error or warning) the error number and the error text.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation of this instance incorporating the error type (error or warning) the error number and the error text.

Overrides
System.Object.ToString()