private bool IsLearningObjectInLearnersCourses(LearningObject learningObject, int learnerId) { var courseId = _lectureRepository.GetCourseIdByLOId(learningObject.LearningObjectSummaryId); var learner = _learnerRepository.GetById(learnerId); return(learner.CourseEnrollments.Any(learnerCourseEnrollment => learnerCourseEnrollment.CourseId == courseId)); }