public async Task <IActionResult> Index() { var model = new VendingMachineData(); try { model.Products = (await _vendingService.GetAvailableProductsAsync()).Products; model.Denominations = _vendingService.GetDenominations(); model.Deposit = (await _vendingService.GetDepositAsync()).TotalAmount; } catch (HttpRequestException e) { model.ErrorMessage = e.Message; } return(View(model)); }