예제 #1
0
        public async Task <IActionResult> Checkout(Application model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var user   = _appUserParser.Parse(HttpContext.User);
                    var basket = _applicationSvc.MapApplicationToBasket(model);

                    await _basketSvc.Checkout(basket);

                    //Redirect to historic list.
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", $"It was not possible to create a new application, please try later on ({ex.GetType().Name} - {ex.Message})");
            }

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