2using System.Diagnostics.CodeAnalysis;
4using Microsoft.AspNetCore.Mvc;
22 [MemberNotNullWhen(
false, nameof(
Result))]
23 [MemberNotNullWhen(
false, nameof(
Result))]
42 : base(errorMessage, httpResponse)
53 Result = result ??
throw new ArgumentNullException(nameof(result));
Represents an error message returned by the server.
Represents a response from an authority.
TResult? Result
The success TResult .
virtual bool Success
Checks if the AuthorityResponse was successful.
AuthorityResponse(ErrorMessageResponse errorMessage, HttpFailureResponse httpResponse)
Initializes a new instance of the AuthorityResponse<TResult> class.
AuthorityResponse(TResult result, HttpSuccessResponse httpResponse=HttpSuccessResponse.Ok)
Initializes a new instance of the AuthorityResponse<TResult> class.
HttpSuccessResponse? SuccessResponse
The HttpSuccessResponse for generating the IActionResults.
bool? IsNoContent
Checks if a the AuthorityResponse<TResult> is a no content result. Only set on Success.
AuthorityResponse()
Initializes a new instance of the AuthorityResponse<TResult> class.
HttpFailureResponse
Indicates the type of HTTP status code an failing AuthorityResponse should generate.
HttpSuccessResponse
Indicates the type of HTTP status code a successful AuthorityResponse<TResult> should generate.