public ActionResult Create(OrderVM model) { //Debug.WriteLine(_orderBL.GetBread(_orderVM.BreadSelection).Breadtype); try { if (ModelState.IsValid) { _orderBL.AddOrder(_custBL.GetCustomerById(model.CustomerId), new Orders { Id = model.Id, CustomerId = model.CustomerId, Loaf = _orderBL.GetBread(model.BreadSelection), BreadCount = model.BreadCount }, model.LocationSelection); return(RedirectToAction(nameof(Index), new { id = model.CustomerId })); } return(View(model)); } catch { Debug.WriteLine("Error"); return(View(model)); } }