示例#1
0
        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();
 }
示例#4
0
 public ClassResourcesRepository() : base(WaffleContext.CreateDb())
 {
     _db = WaffleContext.CreateDb();
 }
示例#5
0
 public ClassPlaylistRepository()
     : base(WaffleContext.CreateDb())
 {
 }
示例#6
0
 public UserController()
 {
     _db      = WaffleContext.CreateDb();
     userRepo = new UserRepository();
 }