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())));
        }
Ejemplo n.º 2
0
 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;
         }
     }
 }