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