// GET: SupplierController/Delete/5 public ActionResult Delete(int id) { var supplier = _repo.FindById(id); if (supplier == null) { return(NotFound()); } var isSuccess = _repo.Delete(supplier); if (!isSuccess) { return(BadRequest()); } return(RedirectToAction(nameof(Index))); }