public async Task <IActionResult> Details(string productCode) { return(await resiliencyHelper.ExecuteResilient(async() => { var inventory = await inventoryManagementAPI.GetInventoryByProductCode(productCode); var model = new InventoryDetailViewModel() { Inventory = inventory }; return View(model); }, View("Offline", new InventoryOfflineViewModel()))); }
public async Task <Inventory> GetInventoryByProductCode(string productCode) { try { return(await restClient.GetInventoryByProductCode(productCode)); } catch (ApiException ex) { if (ex.StatusCode == HttpStatusCode.NotFound) { return(null); } else { throw; } } }