public ActionResult Edit(int id, Employee employee) { try { // TODO: Add update logic here m_repo.UpdateEmployee(employee); m_repo.DeleteEmployee(m_repo.GetEmployeeById(id)); //magic line of workingness return(RedirectToAction("Index")); } catch { return(View()); } }