private List <SelectListItem> GetAllTestsByTeacherId(Guid teacherId) { return(_testsRepository.GetAllTestsOfTeacherAsync(teacherId) .Result.Select(element => new SelectListItem { Value = element.Id.ToString(), Text = element.Name }) .ToList()); }
public IActionResult Index() { var testTemplates = _testsRepository.GetAllTestsOfTeacherAsync(_userId).Result; if (testTemplates == null) { return(NotFound()); } var indexTestTemplatesViewModel = _mapper.Map <IEnumerable <IndexTestTemplatesViewModel> >(testTemplates); return(View(indexTestTemplatesViewModel)); }