コード例 #1
0
        public async Task <IActionResult> DeleteUserCart(long userId)
        {
            try
            {
                var cartList = await _cartRepo.GetCartByUserId(userId);

                foreach (var item in cartList)
                {
                    var test = DeleteCart(cartList);
                }
                return(View());
            }
            catch (Exception ex)
            {
                _logger.LogError("CONTROLLER CART -- DeleteUserCart() -- Error on Controller: ", ex);
                return(BadRequest());
            }
        }
コード例 #2
0
        public Cart GetCartByUserId(int UserId)
        {
            Cart cart = repo.GetCartByUserId(UserId);

            return(cart);
        }