Beispiel #1
0
        private async Task CreateAnExample()
        {
            var subAction = new PerformanceSubAction {
                Type = "Post request"
            };

            try
            {
                await exampleRestApiClient.PostResultFromExampleAsync(new ExampleRequest());
            }
            catch (ApiException ex)
            {
                subAction.HasErrors = true;
                subAction.Error     = $"{ex.StatusCode} -- {ex.Response}";
            }
            catch (Exception ex)
            {
                subAction.HasErrors = true;
                subAction.Error     = ex.Message;
            }
            finally
            {
                subAction.StopWatch();
                performanceAction.PerformanceSubActions.Add(subAction);
            }
        }
 private async Task PerformPostFromExampleAsync(ExampleRequest request)
 {
     try
     {
         apiResponse = await exampleRestApiClient.PostResultFromExampleAsync(request);
     }
     catch (ApiException ex)
     {
         apiException = ex;
     }
 }