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()); } }
public Cart GetCartByUserId(int UserId) { Cart cart = repo.GetCartByUserId(UserId); return(cart); }