public async Task <APIResponse> GetServicesofVendor(string vendorId) { try { var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName); var response = await client.GetAsync(servicesConfig.Vendor + VendorServiceOperation.GetServicesofVendor(vendorId)); if (response.IsSuccessStatusCode) { var serviceQuestion = JsonConvert.DeserializeObject <List <ServiceDetailsResponse> >(await response.Content.ReadAsStringAsync()); return(new APIResponse(serviceQuestion, HttpStatusCode.OK)); } return(new APIResponse(response.StatusCode)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'GetServicesofVendor()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }