示例#1
0
        public HttpResponseMessage ChangeQuantity([FromBody] List <Product> items)
        {
            //Intialise service object to access service methods
            ProductServices productService = new ProductServices();

            //Return list of items after removing the selected ietms by the user
            var cartItems = productService.ChangeQuantity(items, (List <Product>)HttpContext.Current.Session["CartList"]);

            //Update  session with the latest list after removing the items
            HttpContext.Current.Session["CartList"] = (List <Product>)cartItems;

            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Headers.Location = new Uri("http://localhost:55857/Cart");

            return(response);
        }