public void DeleteTheme(int?Id = null) { if (disciplineRepository.Disciplines.FirstOrDefault(ob => ob.Theme.FirstOrDefault(tm => tm.ThemeId == Id) != null) != null) { disciplineRepository.DeleteTheme(disciplineRepository.Disciplines.FirstOrDefault(ob => ob.Theme.FirstOrDefault(tm => tm.ThemeId == Id) != null).Theme.FirstOrDefault(tm => tm.ThemeId == Id)); } }