public ActionResult Edit(int id, Department department) { if (ModelState.IsValid) { Department dbDepartment = _buisnessLogicClass.GetDepartmentByID(id); dbDepartment.Name = department.Name; _buisnessLogicClass.UpdateDepartment(dbDepartment); //Return to index... return(RedirectToAction(nameof(Index))); } else { return(BadRequest()); } }