public IActionResult DeleteUniversity(int id) { if (!_repo.UniversityExists(id)) { return(NotFound()); } var uni = _repo.GetById(id); if (!_repo.DeleteUniversity(uni)) { ModelState.AddModelError("Error !", $"Something went wrong when deleting the record {uni.Name}"); return(StatusCode(500, ModelState)); } return(NoContent()); }
private void DeleteUniversity(int id) { _uniRep.DeleteUniversity(id); _fileRep.DeleteFolder(Path.Combine(StoragePath, id.ToString())); }