Ejemplo n.º 1
0
        //[HttpPost]
        public IActionResult AddToCart(int id)
        {
            var product = _productService.GetByID(id);
            var userId  = _userManager.GetUserId(User);

            _cartService.AddItemToCart(product, userId);
            _cartService.AddTotal(userId);
            return(RedirectToAction("Index"));
        }