Пример #1
0
 public UnitOfWork(DbContextOptions <ElearnerAppContext> optionsBuilder)
 {
     _context        = new ElearnerAppContext(optionsBuilder);
     UserRepo        = new UserRepository(_context);
     CourseRepo      = new CourseRepository(_context);
     SectionRepo     = new SectionRepository(_context);
     LessonRepo      = new LessonRepository(_context);
     CategoryRepo    = new CategoryRepository(_context);
     ApplicationRepo = new ApplicationRepository(_context);
 }
Пример #2
0
 public LessonRepository(ElearnerAppContext context)
 {
     _context = context;
 }
Пример #3
0
 public CourseRepository(ElearnerAppContext context)
 {
     _context = context;
 }
Пример #4
0
 public SectionRepository(ElearnerAppContext context)
 {
     _context = context;
 }
Пример #5
0
 // cant use dependancy injection here since we neewd to call saveChanges on the context frsom the unitofwork
 // so we need to parse the context from the unitofwork
 public UserRepository(ElearnerAppContext context)
 {
     _context = context;
 }