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); }
public LessonRepository(ElearnerAppContext context) { _context = context; }
public CourseRepository(ElearnerAppContext context) { _context = context; }
public SectionRepository(ElearnerAppContext context) { _context = context; }
// 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; }