예제 #1
0
 private List <SelectListItem> GetAllTestsByTeacherId(Guid teacherId)
 {
     return(_testsRepository.GetAllTestsOfTeacherAsync(teacherId)
            .Result.Select(element => new SelectListItem
     {
         Value = element.Id.ToString(),
         Text = element.Name
     })
            .ToList());
 }
예제 #2
0
        public IActionResult Index()
        {
            var testTemplates = _testsRepository.GetAllTestsOfTeacherAsync(_userId).Result;

            if (testTemplates == null)
            {
                return(NotFound());
            }
            var indexTestTemplatesViewModel = _mapper.Map <IEnumerable <IndexTestTemplatesViewModel> >(testTemplates);

            return(View(indexTestTemplatesViewModel));
        }