public ActionResult EditQuestion(int id) { QuestionViewModel vM = new QuestionViewModel(_categoryDictRepository); vM.ActionName = "EditQuestion"; vM.Question = _questionRepository.GetIdAll(id); for (int i = 0; i < vM.Question.Answer.Count(); i++) { vM.AnswerList[i] = _answerRepository.GetID(vM.Question.Answer.ElementAt(i).Id); } return(View(vM)); }