public void DeleteEpic(int id, int projectId) { var epic = _projectDAO.GetEpicFromId(id); foreach (var userStory in epic.UserStories) { if (userStory.State != UserStoryState.BACKLOG) { throw new CheckedException("Cannot delete epic with used user stories"); } } _projectDAO.DeleteEpic(id, projectId); }