public async Task <List <EnrolmentList> > GetForCourseInstance(CourseInstanceBase courseInstance) { if (courseInstance == null) { return(null); } return(await GetForCourseInstance(courseInstance.CourseId, courseInstance.SemesterId)); }
public async Task <List <EnrolmentList> > GetAvailableForCourseInstance(CourseInstanceBase courseInstance, int examId) { return(await context.Enrolment .Where(_ => _.CourseId == courseInstance.CourseId && _.SemesterId == courseInstance.SemesterId && !_.StudentExam.Any(__ => __.ExamId == examId)) .Select(_ => new EnrolmentList { Id = _.Id, Student = new StudentBase { Id = _.Student.Id, Firstname = _.Student.Firstname, Lastname = _.Student.Lastname, IndexNmb = _.Student.IndexNmb, Jmbag = _.Student.Jmbag } }).ToListAsync()); }
public async Task GetEnrolments(CourseInstanceBase courseInstance) { EnrolmentsList = await _enrolmentService.GetForCourseInstance(courseInstance); }