Exemplo n.º 1
0
        public async Task <IActionResult> PlaceOrder(Order order)
        {
            try {
                if (ModelState.IsValid)
                {
                    var user = _appUserParser.Parse(HttpContext.User);

                    await _orderSvc.PlaceOrder(order);

                    //Redirect to historic list.
                    return(RedirectToAction("Index"));
                }
            } catch (BrokenCircuitException) {
                ModelState.AddModelError("Error", "It was not possible to create a new order, please try later on. (Business Msg Due to Circuit-Breaker)");
            }

            return(View("Create", order));
        }