public ActionResult Delete(int productId) { Product deletedProduct = db.DeleteProduct(productId); if (deletedProduct != null) { TempData["message"] = string.Format("Продукт \"{0}\" был удалён", deletedProduct.Name); } return(RedirectToAction("IndexProduct")); }
public int DeleteProduct(int id) { return(_productContext.DeleteProduct(id)); }
public void Delete(Guid id) { productContext.DeleteProduct(id); }