public IActionResult CreateCategoryTest(CreateCategoryTestViewModel viewModel)
        {
            var test = new CategoryTestModel
            {
                CategoryID     = viewModel.SelectedCategoryID,
                Description    = viewModel.Description,
                ExpectedResult = viewModel.ExpectedResult
            };

            _database.CategoryTests.Add(test);
            _database.SaveChanges();

            return(RedirectToAction("Index"));
        }
        public IActionResult CreateCategoryTest(Guid id)
        {
            var categories = _database.Categories.ToList();

            var viewModel = new CreateCategoryTestViewModel
            {
                CategoriesList     = new SelectList(categories, "ID", "Name"),
                SelectedCategoryID = id
            };

            if (viewModel.SelectedCategoryID != null)
            {
                viewModel.CategoriesList.First(c => c.Value == viewModel.SelectedCategoryID.ToString()).Selected = true;
            }

            return(View(viewModel));
        }