public virtual ActionResult List(int questionId, AnswerDataSource datasource = null) { datasource.Data = Mapper.Map <List <AnswerViewModel> >(_answersRepository.GetList(questionId)); datasource.Initialize(); var question = _questionsRepository.GetById(questionId); datasource.QuestionId = questionId; datasource.QuestionText = question.Text; datasource.QuestionnaireId = question.QuestionnaireId; return(View(datasource)); }
public virtual ActionResult DataSource(AnswerDataSource datasource) { return(List(datasource.QuestionId, datasource)); }