public static WordsDictionary GetWordsDictionaryOrNull(this ILectureRepository _lectureRepository, Guid id) { var lecture = _lectureRepository.GetOnlyDictionary(id); if (lecture == null) { throw new Exception($"Słownik dla podanego wykladu o podanym id: {id} nie istnieje"); } return(lecture); }