Beispiel #1
0
 public IActionResult AddCartItem(long productId)
 {
     try
     {
         var result = _cartService.AddCartItemForUser(GetUserFromContext(), productId);
         return(Ok(result));
     }
     catch (KeyNotFoundException e)
     {
         return(NotFound("Product with id " + productId + " doesn't exist"));
     }
 }