public IQueryable <SubscriptionDto> Courses([FromBody] SubscriptionCourseModel model)
        {
            var memberService   = new MemberService(Db);
            var semService      = new SemesterService(Db);
            var teachingService = new TeachingService(Db);

            var list = new List <SubscriptionDto>();

            var user    = GetUser(model.Id.ToString());
            var members = memberService.GetFacultyMemberships(user.Id);


            var semester = semService.GetSemester(DateTime.Today);


            var teaching = teachingService.GetActivities(semester, user, members);


            foreach (var course in teaching.Courses)
            {
                var subModel = new SubscriptionDto();

                subModel.CourseId = course.Course.Id;
                subModel.Title    = course.Course.Name;

                list.Add(subModel);
            }

            return(list.AsQueryable());
        }
        public IQueryable <SubscriptionDto> Subscriptions([FromBody] SubscriptionCourseModel model)
        {
            var studService = new StudentService(Db);
            var semService  = new SemesterService(Db);

            var list = new List <SubscriptionDto>();

            var user     = GetUser(model.Id.ToString());
            var student  = studService.GetCurrentStudent(user.Id);
            var semester = semService.GetSemester(DateTime.Today);

            var courses = Db.Activities.OfType <Course>().Where(a =>
                                                                a.SemesterGroups.Any(g => g.Semester.Id == semester.Id) &&
                                                                a.Occurrence.Subscriptions.Any(u => u.UserId.Equals(user.Id))).ToList();

            foreach (var course in courses)
            {
                var subscription =
                    course.Occurrence.Subscriptions.FirstOrDefault(x => x.UserId.Equals(user.Id));

                var subModel = new SubscriptionDto();

                subModel.CourseId      = course.Id;
                subModel.IsValid       = true;
                subModel.OnWaitingList = subscription.OnWaitingList;
                subModel.Title         = course.Name;

                list.Add(subModel);
            }

            return(list.AsQueryable());
        }