/// <summary>
 /// Processes the response.
 /// </summary>
 /// <param name="url">The URL.</param>
 /// <param name="response">The response.</param>
 /// <param name="data">The data.</param>
 public void ProcessResponse(string url, HttpResponseMessage response, string data, string loglevel = "Debug")
 {
     if (loglevel.ToUpper() == "INFO")
     {
         ApiLogger.Info($"{url}\n-[{(int)response.StatusCode}][data:{data ?? string.Empty}]");
     }
     else
     {
         ApiLogger.Debug($"{url}\n-[{(int)response.StatusCode}][data:{data ?? string.Empty}]");
     }
     response.EnsureSuccessStatusCode();
 }
        public async Task <IActionResult> GetAll()
        {
            ApiLogger.Info("Getting all customers!");
            using (var customerService = new CustomerService(ApiLogger, new UnitOfWork(ApiLogger, SalesContext), Mapper))
            {
                try
                {
                    await Task.Delay(1000);

                    var customers = await customerService.LoadAllCustomersAsync();

                    return(Ok(customers));
                } catch (Exception ex)
                {
                    ApiLogger.Error("Error while getting all customers!", ex: ex);
                    return(StatusCode(500));
                }
            }
        }
        public async Task <IActionResult> GetAll()
        {
            ApiLogger.Info("Getting all available apps!");
            using (var appService = new AppService(ApiLogger, new UnitOfWork(ApiLogger, SalesContext), Mapper))
            {
                try
                {
                    await Task.Delay(2000);

                    var apps = await appService.LoadAllAppsAsync();

                    return(Ok(apps));
                }
                catch (Exception ex)
                {
                    ApiLogger.Error("Error while getting all apps!", ex: ex);
                    return(StatusCode(500));
                }
            }
        }