コード例 #1
0
        public IActionResult AddToCarte(int productId, string returnUrl)
        {
            Product product = _dBaseTechProduct.dbProducts.FirstOrDefault(p => p.ProductID == productId);

            if (product != null)
            {
                carte.AddItem(product, 1);

                Carte.returnUrl = returnUrl;
            }

            //return View();
            return(RedirectToAction(nameof(Index)));
        }