Beispiel #1
0
        //sepeti boşaltma
        public IActionResult Delete(string customerUsername)
        {
            ServiceResponse <ShoppingCartItem> response = new ServiceResponse <ShoppingCartItem>();

            List <ShoppingCartItem> shoppingCartItem = _shoppingCartItemService.GetEx(s => s.CustomerUserName == customerUsername).ToList();

            if (shoppingCartItem == null || shoppingCartItem.Any())
            {
                response.HasError = true;
                response.Errors.Add("Shopping Cart Item Does Not Exist!");

                return(BadRequest(response));
            }

            _shoppingCartItemService.ClearCart(shoppingCartItem);

            response.IsSuccess = true;

            return(Ok(response));
        }