public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Catagory catagory = _manager.GetById((int)id); bool isDeleted = _manager.Remove(catagory); if (isDeleted) { return(RedirectToAction("Index")); } return(View(catagory)); }
public IActionResult Delete(int?id) { if (id != null && id > 0) { var catagory = _catagoryManager.GetById(id); bool isdelete = _catagoryManager.Remove(catagory); if (isdelete) { return(RedirectToAction("List")); } } return(RedirectToAction("List")); }