public override void InitParams() { dbSet = _context.Timetables; r = new TimetablesRepository(_context); model1 = new Timetable { Classroom = _context.Classrooms.FirstOrDefault(), TeachSubj = _context.TeachSubjs.FirstOrDefault(), PairTimetable = _context.PairTimetables.FirstOrDefault() }; model2 = new Timetable { Classroom = null, TeachSubj = null, PairTimetable = null }; }
static Unit() { _context = new MyAppDbContext("MyAppConnStr"); AddressesRepository = new AddressesRepository(_context); ClassroomsRepository = new ClassroomsRepository(_context); DepartmentsRepository = new DepartmentsRepository(_context); GroupsRepository = new GroupsRepository(_context); GroupTimetablesRepository = new GroupTimetablesRepository(_context); MarksRepository = new MarksRepository(_context); PairTimetablesRepository = new PairTimetablesRepository(_context); PhonesRepository = new PhonesRepository(_context); SpecialitiesRepository = new SpecialitiesRepository(_context); StudentsRepository = new StudentsRepository(_context); SubjectsRepository = new SubjectsRepository(_context); TeachSubjsRepository = new TeachSubjsRepository(_context); TeachersRepository = new TeachersRepository(_context); TimetablesRepository = new TimetablesRepository(_context); }