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
Type | Name |
---|---|
System.Enum | errorCode |
CreateException(Enum, String)
View Source
Declaration
public static ValidationError CreateException(Enum errorCode, string errorMessage)
Returns
ServiceStack.Validation.ValidationError
Parameters
Type | Name |
---|---|
System.Enum | errorCode |
System.String | errorMessage |
CreateException(Enum, String, String)
View Source
Declaration
public static ValidationError CreateException(Enum errorCode, string errorMessage, string fieldName)
Returns
ServiceStack.Validation.ValidationError
Parameters
Type | Name |
---|---|
System.Enum | errorCode |
System.String | errorMessage |
System.String | fieldName |
CreateException(String)
View Source
Declaration
public static ValidationError CreateException(string errorCode)
Returns
ServiceStack.Validation.ValidationError
Parameters
Type | Name |
---|---|
System.String | errorCode |
CreateException(String, String)
View Source
Declaration
public static ValidationError CreateException(string errorCode, string errorMessage)
Returns
ServiceStack.Validation.ValidationError
Parameters
Type | Name |
---|---|
System.String | errorCode |
System.String | errorMessage |
CreateException(String, String, String)
View Source
Declaration
public static ValidationError CreateException(string errorCode, string errorMessage, string fieldName)
Returns
ServiceStack.Validation.ValidationError
Parameters
Type | Name |
---|---|
System.String | errorCode |
System.String | errorMessage |
System.String | fieldName |
CreateException(ValidationErrorField)
View Source
Declaration
public static ValidationError CreateException(ValidationErrorField error)
Returns
ServiceStack.Validation.ValidationError
Parameters
Type | Name |
---|---|
ServiceStack.Validation.ValidationErrorField | error |
ThrowIfNotValid(ValidationErrorResult)
View Source
Declaration
public static void ThrowIfNotValid(ValidationErrorResult validationResult)
Parameters
Type | Name |
---|---|
ServiceStack.Validation.ValidationErrorResult | validationResult |
ToResponseStatus()
View Source
Declaration
public ResponseStatus ToResponseStatus()
Returns
Implements
System.Runtime.InteropServices._Exception
System.Runtime.Serialization.ISerializable
- ServiceStack.Model.IResponseStatusConvertible