예제 #1
0
        public QuestionDTO QuestionToQuestionDTO(Question question)
        {
            QuestionDTO questionDTO = new QuestionDTO();

            questionDTO.id           = question.id;
            questionDTO.QuestionText = question.QuestionText;
            questionDTO.Category     = question.Category;
            questionDTO.Answers      = new AnswerDTO[question.Answers.Length];
            AnswerMapper mapper = new AnswerMapper();

            for (int i = 0; i < question.Answers.Length; i++)
            {
                questionDTO.Answers[i] = mapper.AnswerToAnswerDTO(question.Answers[i]);
            }

            return(questionDTO);
        }