DtoUtils
Assembly: ServiceStack.dll
View Source
Declaration
public static class DtoUtils
Fields
ResponseStatusPropertyName
Naming convention for the ResponseStatus property name on the response DTO
View Source
Declaration
public const string ResponseStatusPropertyName = "ResponseStatus"
Methods
CreateResponseStatus(Exception, Object, Boolean)
View Source
Declaration
public static ResponseStatus CreateResponseStatus(Exception ex, object request = null, bool debugMode = false)
Returns
Parameters
Type | Name |
---|---|
System.Exception | ex |
System.Object | request |
System.Boolean | debugMode |
ToResponseStatus(Exception, Object)
View Source
Declaration
public static ResponseStatus ToResponseStatus(this Exception exception, object requestDto = null)
Returns
Parameters
Type | Name |
---|---|
System.Exception | exception |
System.Object | requestDto |
ToResponseStatus(ValidationError)
View Source
Declaration
public static ResponseStatus ToResponseStatus(this ValidationError validationException)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Validation.ValidationError | validationException |
ToResponseStatus(ValidationErrorResult)
View Source
Declaration
public static ResponseStatus ToResponseStatus(this ValidationErrorResult validationResult)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Validation.ValidationErrorResult | validationResult |
CreateSuccessResponse(String)
View Source
Declaration
public static ResponseStatus CreateSuccessResponse(string message)
Returns
Parameters
Type | Name |
---|---|
System.String | message |
CreateResponseStatus(String)
View Source
Declaration
public static ResponseStatus CreateResponseStatus(string errorCode)
Returns
Parameters
Type | Name |
---|---|
System.String | errorCode |
CreateResponseStatus(String, String)
View Source
Declaration
public static ResponseStatus CreateResponseStatus(string errorCode, string errorMessage)
Returns
Parameters
Type | Name |
---|---|
System.String | errorCode |
System.String | errorMessage |
CreateErrorResponse(String, String, IEnumerable<ValidationErrorField>)
View Source
Declaration
public static object CreateErrorResponse(string errorCode, string errorMessage, IEnumerable<ValidationErrorField> validationErrors)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | errorCode |
System.String | errorMessage |
System.Collections.Generic.IEnumerable<ServiceStack.Validation.ValidationErrorField> | validationErrors |
CreateErrorResponse(Object, ValidationErrorResult)
View Source
Declaration
public static object CreateErrorResponse(object request, ValidationErrorResult validationError)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | request |
ServiceStack.Validation.ValidationErrorResult | validationError |
CreateErrorResponse(Object, Exception, ResponseStatus)
View Source
Declaration
public static object CreateErrorResponse(object request, Exception ex, ResponseStatus responseStatus)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | request |
System.Exception | ex |
ServiceStack.ResponseStatus | responseStatus |
CreateResponseDto(Object, ResponseStatus)
Create an instance of the service response dto type and inject it with the supplied responseStatus
View Source
Declaration
public static object CreateResponseDto(object request, ResponseStatus responseStatus)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | request |
ServiceStack.ResponseStatus | responseStatus |
CreateErrorResponse(Object, Exception)
Create an Error Response DTO for the specified Request DTO from the Exception
View Source
Declaration
public static object CreateErrorResponse(object request, Exception ex)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | request |
System.Exception | ex |