Ejemplo n.º 1
0
 //=======================================================================================
 public IActionResult Index()
 {
     using (var client = new DisciplineRepository())
     {
         return(View(client.TakeAllView()));
     }
 }
 public IActionResult Index()
 {
     using (var client = new ApplicationDbContext())
     {
         using (var disciplineRepository = new DisciplineRepository(client))
         {
             using (var threadRepository = new ThreadRepository(client))
             {
                 using (var questionRepository = new QuestionRepository(client))
                 {
                     return(View(new RepositoryView
                     {
                         QuestionViews = questionRepository.TakeAllView(),
                         ThreadViews = threadRepository.TakeAllView(),
                         DisciplineViews = disciplineRepository.TakeAllView(),
                         /*TestViews = client.T.Take(10).ToList().Select(q => new QuestionView()).ToList(),*/
                     }));
                 }
             }
         }
     }
 }