public IActionResult DeleteConfirmed(int id)
        {
            var cart = cartProductService.GetById(id);

            cartProductService.Delete(cart);
            return(RedirectToAction(nameof(Index)));
        }
        public async Task <ActionResult> DeleteCartProductDetail(int id)
        {
            var product = await _cartproductService.Get(id);

            if (product == null)
            {
                return(NotFound());
            }
            await _cartproductService.Delete(product);

            return(Ok(product));
        }
Exemple #3
0
        public IActionResult DeleteFromCart(long pId)
        {
            _cartProductService.Delete(pId);

            if (_cartService.SaveChanges() == 0)
            {
                return(RedirectToAction("Index", new { msg = "Bir hata oluştu." }));
            }
            else
            {
                return(RedirectToAction("Index", new { msg = "Ürün sepetten çıkarıldı." }));
            }
        }