Skip to content

7 Extensions

TimCodes.NET edited this page Dec 1, 2023 · 1 revision

You may like to use some of the extension methods provided out-the-box:

AddVariationForStatusCode(this ApiResponseVariationResolver apiResponseVariationResolver, HttpStatusCode code, ApiResponseVariation variation)

Adds a ResponseVariation to a resolver for a given Status Code response.

TEnum? GetErrorEnum<TEnum>(this HttpApiMessageBase message)

Gets the enum value of the error code in a failed response.

TResponse ToSpecificResponse<TResponse>(this IApiResponse response)

Gets the content of a response out in the specified type, or throws an exception if the type is mismatched or null.

Clone this wiki locally