public ActionResult AboutTest(int testId) { Mapper.CreateMap <ThemeDto, ThemeViewModel>(); Mapper.CreateMap <TestDto, TestViewModel>(); TestViewModel test = Mapper.Map <TestDto, TestViewModel>(_service.Get(testId)); return(View(test)); }
public ActionResult Testing(int testId) { TestViewModel test = _mapper.Map <TestDto, TestViewModel>(_service.Get(testId)); //List<Question> questions = test.Questions; foreach (var item in test.Questions) { if (item != null) { item.AnswerVariant = item.Answers.Count(a => a.IsTrue) > 1 ? AnswerVarian.MoreThanOne : AnswerVarian.One; } } //return View(questions); return(View(test)); }