Skip to main content

ValidationError

The exception which is thrown when a validation error occurred. This validation is serialized in a extra clean and human-readable way by ServiceStack.

Assembly: ServiceStack.Client.dll
View Source
Declaration
public class ValidationError : ArgumentException, _Exception, ISerializable, IResponseStatusConvertible

Properties

ErrorMessage

View Source
Declaration
public string ErrorMessage { get; }

ErrorCode

Returns the first error code

View Source
Declaration
public string ErrorCode { get; }

Message

View Source
Declaration
public override string Message { get; }

Violations

View Source
Declaration
public IList<ValidationErrorField> Violations { get; }

Methods

ToXml()

Used if we need to serialize this exception to XML

View Source
Declaration
public string ToXml()
Returns

System.String

CreateException(Enum)

View Source
Declaration
public static ValidationError CreateException(Enum errorCode)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
System.EnumerrorCode

CreateException(Enum, String)

View Source
Declaration
public static ValidationError CreateException(Enum errorCode, string errorMessage)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
System.EnumerrorCode
System.StringerrorMessage

CreateException(Enum, String, String)

View Source
Declaration
public static ValidationError CreateException(Enum errorCode, string errorMessage, string fieldName)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
System.EnumerrorCode
System.StringerrorMessage
System.StringfieldName

CreateException(String)

View Source
Declaration
public static ValidationError CreateException(string errorCode)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
System.StringerrorCode

CreateException(String, String)

View Source
Declaration
public static ValidationError CreateException(string errorCode, string errorMessage)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
System.StringerrorCode
System.StringerrorMessage

CreateException(String, String, String)

View Source
Declaration
public static ValidationError CreateException(string errorCode, string errorMessage, string fieldName)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
System.StringerrorCode
System.StringerrorMessage
System.StringfieldName

CreateException(ValidationErrorField)

View Source
Declaration
public static ValidationError CreateException(ValidationErrorField error)
Returns

ServiceStack.Validation.ValidationError

Parameters
TypeName
ServiceStack.Validation.ValidationErrorFielderror

ThrowIfNotValid(ValidationErrorResult)

View Source
Declaration
public static void ThrowIfNotValid(ValidationErrorResult validationResult)
Parameters
TypeName
ServiceStack.Validation.ValidationErrorResultvalidationResult

ToResponseStatus()

View Source
Declaration
public ResponseStatus ToResponseStatus()
Returns

ServiceStack.ResponseStatus

Implements