Ejemplo n.º 1
0
        public bool AddCart(int id)
        {
            int  userId = GetUserId();
            bool result = _storeService.AddToCart(userId, id);

            return(result);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> AddToCart([FromBody] Cart product)
        {
            var validate = GetAuthorizeHeader();

            if (validate == null)
            {
                return(Unauthorized());
            }
            var result = await _storeService.AddToCart(product);

            if (result.success)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }