Exemple #1
0
        public RedirectToActionResult AddToCart(int Id, string returnUrl)
        {
            Species species = repository.Species.FirstOrDefault(s => s.Id == Id);

            if (species != null)
            {
                CartList cartlist = GetCart();
                cartlist.AddItem(species);
                SaveCart(cartlist);
            }
            return(RedirectToAction("Index", new { returnUrl }));
        }