public ActionResult UpdateCollege(CollegeDetailsModel modelToUpdate) { if (!ModelState.IsValid) { return(View()); } CollegeService collegeService = new CollegeService(); if (collegeService.UpdateCollege(modelToUpdate)) { TempData["toast"] = "College Updated successfully"; return(RedirectToAction("ViewColleges")); } else { ModelState.AddModelError("UpdateCollegeFailedError", "Error in updating the college. The College code should be unique"); return(this.View()); } }