public IActionResult Details()
        {
            var tests = this.TestsService.GetAllForIndexPage();

            var viewModel = new AllTestsViewModel();

            viewModel.Tests = tests;

            return(this.View(viewModel));
        }
Beispiel #2
0
        public IActionResult Index()
        {
            var allTestsViewModel = new AllTestsViewModel();
            var tests             = this.testService.GetAllTests().ToList();

            foreach (var test in tests)
            {
                allTestsViewModel.AllTests.Add
                    (new TestViewModel()
                {
                    Name        = test.Name,
                    Category    = test.CategoryName,
                    IsPublished = test.IsPublished
                });
            }
            return(View(allTestsViewModel));
        }