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