public static IApiClientOperation ValidateWith(this IApiClientOperation operation, ProblemValidator?validator)
 {
     if (validator is not null)
     {
         operation.ConfigureFailure(validator.DisplayErrors);
     }
     return(operation);
 }
 public static IApiClientOperation OnFailureStatusCode(this IApiClientOperation operation, HttpStatusCode statusCode, Action <ProblemDetails> action)
 {
     operation.ConfigureFailure(problem =>
     {
         if (problem.Status == (int)statusCode)
         {
             action(problem);
         }
     });
     return(operation);
 }
 public static IApiClientOperation OnFailure(this IApiClientOperation operation, Action <ProblemDetails> action)
 {
     operation.ConfigureFailure(action);
     return(operation);
 }
 public static IApiClientOperation SendErrorTo(this IApiClientOperation operation, ISnackbar snackbar)
 {
     operation.ConfigureFailure(problem => snackbar.Add(problem.GetDisplayString(), Severity.Error));
     return(operation);
 }