Beispiel #1
0
        public static async Task <List <ClassRoomDTO> > GetAll(DbCourseCtx ctx)
        {
            var result = await GetAllClassRooms(ctx);

            return(result.Select(x => new ClassRoomDTO()
            {
                Name = x.ClassRoomName,
                IdClassRoom = x.IdClassRoom
            }).ToList());
        }
Beispiel #2
0
        public static async Task <List <LessonDTO> > GetAll(DbCourseCtx ctx)
        {
            var result = await GetAllClassRooms(ctx);

            return(result.Select(x => new LessonDTO()
            {
                Name = x.LessonName,
                IdLesson = x.IdLesson
            }).ToList());
        }
Beispiel #3
0
        public static async Task <List <StudentDTO> > GetAll(DbCourseCtx ctx, string search)
        {
            List <StudentDTO> result = new List <StudentDTO>();
            var students             = await GetAllStudents(ctx);

            result = students
                     .Select(student => new StudentDTO
            {
                Name      = student.StudentName,
                SurName   = student.StudentSurname,
                IdStudent = student.IdStudent,
            })
                     .ToList();

            return(result);
        }
Beispiel #4
0
 private static async Task <List <ClassRoom> > GetAllClassRooms(DbCourseCtx ctx)
 {
     return(await ctx.ClassRooms.ToListAsync());
 }
Beispiel #5
0
 private static async Task <List <Student> > GetAllStudents(DbCourseCtx ctx)
 {
     return(await ctx.Students.ToListAsync());
 }