public IActionResult Create() { TestTemplateDTO template; if (TempData["EditTemplate0"] is string templateStr) { template = JsonConvert.DeserializeObject <TestTemplateDTO>(templateStr); } else { template = testTemplateService.GetDefaultTemplate(); } ViewData["AvailableTypes"] = taskTypeService.GetAll().Select(t => new SelectListItem() { Value = t.Id.ToString(), Text = t.Title }); ViewData["AvailableCategories"] = categoryService.GetAll().Select(t => new SelectListItem() { Value = t.Id.ToString(), Text = t.Title }); return(View(template)); }
public IActionResult Create() { ViewData["AvailableTypes"] = taskTypeService.GetAll().Select(t => new SelectListItem() { Value = t.Id.ToString(), Text = t.Title }); ViewData["AvailableCategories"] = categoryService.GetAll().Select(t => new SelectListItem() { Value = t.Id.ToString(), Text = t.Title }); return(View(new TaskDTO())); }