Skip to main content

ApiResultUtils

Assembly: ServiceStack.Client.dll​
View Source​
Declaration
public static class ApiResultUtils

Methods​

ThrowIfError<TResponse>(ApiResult<TResponse>)​

View Source​
Declaration
public static void ThrowIfError<TResponse>(this ApiResult<TResponse> api)
Parameters​
TypeName
ServiceStack.ApiResult<TResponse>api
Type Parameters​
  • TResponse

ToApiResult<TResponse>(Exception)​

View Source​
Declaration
public static ApiResult<TResponse> ToApiResult<TResponse>(this Exception ex)
Returns​

ServiceStack.ApiResult<TResponse>

Parameters​
TypeName
System.Exceptionex
Type Parameters​
  • TResponse

ToApiResult(Exception)​

View Source​
Declaration
public static ApiResult<EmptyResponse> ToApiResult(this Exception ex)
Returns​

ServiceStack.ApiResult<TResponse>

Parameters​
TypeName
System.Exceptionex

Api<TResponse>(IServiceClient, IReturn<TResponse>)​

Annotate Request DTOs with IGet, IPost, etc HTTP Verb markers to specify which HTTP Method is used: https://docs.servicestack.net/csharp-client.html#http-verb-interface-markers

View Source​
Declaration
public static ApiResult<TResponse> Api<TResponse>(this IServiceClient client, IReturn<TResponse> request)
Returns​

ServiceStack.ApiResult<TResponse>

Parameters​
TypeName
ServiceStack.IServiceClientclient
ServiceStack.IReturn<T>request
Type Parameters​
  • TResponse

ApiAsync<TResponse>(IServiceClient, IReturn<TResponse>)​

Annotate Request DTOs with IGet, IPost, etc HTTP Verb markers to specify which HTTP Method is used: https://docs.servicestack.net/csharp-client.html#http-verb-interface-markers

View Source​
Declaration
public static async Task<ApiResult<TResponse>> ApiAsync<TResponse>(this IServiceClient client, IReturn<TResponse> request)
Returns​

System.Threading.Tasks.Task<ServiceStack.ApiResult<<TResponse>>>

Parameters​
TypeName
ServiceStack.IServiceClientclient
ServiceStack.IReturn<T>request
Type Parameters​
  • TResponse

Api(IServiceClient, IReturnVoid)​

Annotate Request DTOs with IGet, IPost, etc HTTP Verb markers to specify which HTTP Method is used: https://docs.servicestack.net/csharp-client.html#http-verb-interface-markers

View Source​
Declaration
public static ApiResult<EmptyResponse> Api(this IServiceClient client, IReturnVoid request)
Returns​

ServiceStack.ApiResult<TResponse>

Parameters​
TypeName
ServiceStack.IServiceClientclient
ServiceStack.IReturnVoidrequest

ApiAsync(IServiceClient, IReturnVoid)​

Annotate Request DTOs with IGet, IPost, etc HTTP Verb markers to specify which HTTP Method is used: https://docs.servicestack.net/csharp-client.html#http-verb-interface-markers

View Source​
Declaration
public static async Task<ApiResult<EmptyResponse>> ApiAsync(this IServiceClient client, IReturnVoid request)
Returns​

System.Threading.Tasks.Task<ServiceStack.ApiResult<ServiceStack.EmptyResponse>>

Parameters​
TypeName
ServiceStack.IServiceClientclient
ServiceStack.IReturnVoidrequest

ToAuthenticateResponse(RegisterResponse)​

Convert AutoLogin RegisterResponse into AuthenticateResponse to avoid additional trip

View Source​
Declaration
public static AuthenticateResponse ToAuthenticateResponse(this RegisterResponse from)
Returns​

ServiceStack.AuthenticateResponse

Parameters​
TypeName
ServiceStack.RegisterResponsefrom