public async Task <int> Add(ProductModel product) { var userId = User.GetId(); var basketId = new BasketId(userId); return(await _basket.AddProduct(basketId, new BasketProduct(product.Id, product.Title, product.Price))); }
public async Task <IActionResult> AddProduct([FromBody] BasketProduct basketProduct) { await basketService.AddProduct(basketProduct); var basketQuantity = await basketService.GetBasketQuantity(); return(Json(new { basketQuantity })); }
public void Post([FromBody] Product product) { _basketService.AddProduct(product); }