public async Task <APIResponse> GetAllBranches(BranchParameters branchParameters) { try { var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName); UriBuilder url = new UriBuilder(servicesConfig.Vendor + VendorServiceOperation.GetAllBranches()); url.Query = QueryStringHelper.ConvertToQueryString(branchParameters); var response = await client.GetAsync(url.ToString()); if (response.IsSuccessStatusCode) { var branch = JsonConvert.DeserializeObject <List <BranchDetailsResponse> >(await response.Content.ReadAsStringAsync()); return(new APIResponse(branch, HttpStatusCode.OK)); } return(new APIResponse(response.StatusCode)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'GetAllBranches()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }