public ClassInfoVM(Class classInfo) { _class = classInfo; using (var db = WaffleContext.CreateDb()) { var _topics = db.ClassTopic .Where(t => t.ClassId == _class.ClassId) .Include(t => t.Playlists) .ToList(); var _resources = db.ClassResource .Where(r => r.ClassId == _class.ClassId) .ToList(); var _discussions = db.ClassDiscussion .Where(d => d.ClassId == _class.ClassId) .ToList(); discussions = _discussions; resources = _resources; topics = _topics; } }
public ClassController() { _db = WaffleContext.CreateDb(); repo = ClassRepository.CreateRepo(); cat = ClassCategoryRepository.CreateRepo(); levels = ClassLevelRepository.CreateRepo(); types = ClassTypeRepository.CreateRepo(); }
public ClassTypeRepository() : base(WaffleContext.CreateDb()) { _db = WaffleContext.CreateDb(); }
public ClassResourcesRepository() : base(WaffleContext.CreateDb()) { _db = WaffleContext.CreateDb(); }
public ClassPlaylistRepository() : base(WaffleContext.CreateDb()) { }
public UserController() { _db = WaffleContext.CreateDb(); userRepo = new UserRepository(); }