public IActionResult Edit(UniversityViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            var universityToEdit = _traversalService.GetUniversity(vm.Id);

            if (universityToEdit == null)
            {
                return(RedirectToAction("ResourceNotFound", "Error", new { error = "uczelnia o podanym Id nie istnieje." }));
            }

            universityToEdit.Update(vm.TitleOrFullName, vm.SubtitleOrAbbreviation);

            bool success = _managementService.UpdateUniversity(universityToEdit);

            if (!success)
            {
                ModelState.AddModelError("ERROR", "Uczelnia o takiej nazwie lub skrócie już istnieje");
                return(View(vm));
            }

            return(RedirectToAction("Universities"));
        }
 public void Update(University university)
 {
     _managementService.UpdateUniversity(university);
 }