Beispiel #1
0
        public String Add([FromRoute] string item)
        {
            string session_id = Request.Headers["session-id"];

            if (session_id == null)
            {
                Console.WriteLine("Session running");
                Guid id = allCarts.AddNewCart(item);
                Response.Headers.Add("session-id", id.ToString());
            }
            else
            {
                allCarts.AddToCart(Guid.Parse(session_id), item);
            }
            return("Item added to Shopping Cart");
        }