Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 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);
        }
Esempio n. 4
0
 private static async Task <List <ClassRoom> > GetAllClassRooms(DbCourseCtx ctx)
 {
     return(await ctx.ClassRooms.ToListAsync());
 }
Esempio n. 5
0
 private static async Task <List <Student> > GetAllStudents(DbCourseCtx ctx)
 {
     return(await ctx.Students.ToListAsync());
 }