private void ExcecuteDeleteDepartments() { AllDepartments = _depoRepo.GetAllDepartments(); foreach (var goal in Goals) { goal.RelatedDepartments.RemoveAll(x => x == SelectedGoal.Id); } AllDepartments.Single(x => x.Id == SelectedDepartment.Id).Deleted = true; _depoRepo.SaveDepartments(AllDepartments); AllDepartments = _depoRepo.GetAllDepartments(); UpdateCanvas(); }