Ejemplo n.º 1
0
        public ActionResult Create(int id, short quantity = 1)
        {
            if (string.IsNullOrEmpty(Cookie.Key))
            {
                Cookie.Key = RandomBuilder.RandomLong().ToString();
            }
            Cart obj = new Cart
            {
                CartId    = Identity.Key,
                ProductId = id,
                Quantity  = quantity
            };

            app.Cart.Add(obj);
            return(RedirectToAction(string.Empty));
        }