예제 #1
0
        public IActionResult AddDishToCart(int dishId)
        {
            if (HttpContext.Session.GetInt32("Cart") == null)
            {
                var newCart = _cartService.AddDishToNewCart(dishId, HttpContext);

                return(PartialView("_Cart", newCart));
            }
            else
            {
                var currentCart = _cartService.AddDishToExistingCart(dishId, HttpContext);

                return(PartialView("_Cart", currentCart));
            }
        }