//public ActionResult Delete(int BranchId) //{ // int id = _branchRepo.DeleteBranch(BranchId); // if (id > 0) // { // ResponseMessage = "Data successfully deleted."; // } // return RedirectToAction("Index"); //} public ActionResult Delete(int Id) { string id = _branchRepo.DeleteBranch(Id); // if (id > 0) //{ ResponseMessage = "Data successfully deleted."; //} return(RedirectToAction("Index")); }
public ActionResult Deletebranch(int id) { var branchModelFromRepo = _repository.GetBranchById(id); if (branchModelFromRepo == null) { return(NotFound()); } _repository.DeleteBranch(branchModelFromRepo); _repository.SaveChanges(); return(NoContent()); }