2using System.Diagnostics.CodeAnalysis;
3using System.Linq.Expressions;
5using Microsoft.AspNetCore.Mvc;
19 public static Expression<Func<TResult, AuthorityResponse<TResult>>>
MappingExpression {
get; }
28 [MemberNotNullWhen(
false, nameof(
Result))]
29 [MemberNotNullWhen(
false, nameof(
Result))]
35 public TResult?
Result {
get;
private init; }
59 : base(errorMessage, httpResponse)
70 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.
static Expression< Func< TResult, AuthorityResponse< TResult > > > MappingExpression
An expression to convert a TResult into an AuthorityResponse<TResult>. The resulting AuthorityRespon...
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.
static AuthorityResponse()
Initializes static members of the AuthorityResponse<TResult> class.
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.