public IActionResult Delete(int id) { bool result = true; string errorMsg = ""; var created = eFProductManager.DeleteProduct(id); result = created.IsSuccess; errorMsg = created.ErrorMessage; return(Json(new { result, errorMsg })); }
public IActionResult Delete(int ProductID) { var res = repo.DeleteProduct(ProductID); if (res.IsSuccess) { TempData["message"] = "Product has been deleted"; } else { TempData["error"] = res.ErrorMessage; } return(RedirectToAction("Index")); }