public IActionResult Checkout(string command) { try { if (command == "drop") { cRepo.ClearCart(); return(View("index")); } else { var cartItems = (from item in CIRepo.CartItems select item).ToList(); return(View("checkoutconfirm", cartItems)); } } catch { return(View("Error", "home")); } //if (command=="drop") //{ // cRepo.ClearCart(); // return View("index"); //} //else //{ // var cartItems = (from item in CIRepo.CartItems // select item).ToList(); // return View("checkoutconfirm",cartItems); //} }
public IActionResult Checkout(string command) { if (command == "drop") { cRepo.ClearCart(); return(View("index")); } else { var cartItems = (from item in CIRepo.CartItems select item).ToList(); return(View("checkoutconfirm", cartItems)); } }