Example #1
0
 public AdminController(EfDbContext context, IStudents students, ITeachers teachers, IGroups groups, ISpecialities specialities, ILessons lessons)
 {
     _context      = context;
     _students     = students;
     _teachers     = teachers;
     _groups       = groups;
     _specialities = specialities;
     _lessons      = lessons;
 }
 public static void SimpleJoin(ITeachers teachers, IStudents students)
 {
     var teacherStudenList = from tList in teachers.List
                             join sList in students.List
                             on tList.Name equals sList.HomeRoomTeacher into joinedList
                             from sList in joinedList.DefaultIfEmpty(new Student() { Name = "-" })
                             select new
                             {
                                 TeacherName = tList.Name,
                                 StudentName = sList.Name
                             };
     foreach (var row in teacherStudenList)
     {
         System.Console.WriteLine("{0}\t{1}", row.TeacherName, row.StudentName);
     }
 }
        public static void SimpleJoin(ITeachers teachers, IStudents students)
        {
            var teacherStudenList = from tList in teachers.List
                                    join sList in students.List
                                    on tList.Name equals sList.HomeRoomTeacher into joinedList
                                    from sList in joinedList.DefaultIfEmpty(new Student()
            {
                Name = "-"
            })
                                    select new
            {
                TeacherName = tList.Name,
                StudentName = sList.Name
            };

            foreach (var row in teacherStudenList)
            {
                System.Console.WriteLine("{0}\t{1}", row.TeacherName, row.StudentName);
            }
        }
 public TeachersController(ITeachers tec)
 {
     teachers = tec;
 }
 public ChangeTimetableController(IGroups groupRepo, EfDbContext context, ITeachers teachersRepo)
 {
     _context      = context;
     _teachersRepo = teachersRepo;
     _groupRepo    = groupRepo;
 }