Exemplo n.º 1
0
        public ActionResult Add(int id)
        {
            string userId = GetCartId();

            ShoppingCartHelper shopCartHelper = new ShoppingCartHelper();
            int numItems = shopCartHelper.Add(id, userId);

            // Display the confirmation message
            var result = new AddToCartViewModel()
            {
                NumItems = numItems.ToString()
            };

            return Json(result);
        }