Пример #1
0
        public static EditQuestionRequest ToEditQuestionRequest(this Question question)
        {
            EditQuestionRequest editQuestionRequest = new EditQuestionRequest()
            {
                Id          = question.Id,
                Title       = question.Title,
                Explanation = question.Explanation,
                ImageUrl    = UrlHelper.GetUri(question.Image),
                Answers     = AnswerMapper.ToListUpdateAnswerRequest(question.QuestionAnswers.Select(x => x.Answer).ToList())
            };

            return(editQuestionRequest);
        }
Пример #2
0
        public static EditQuestionRequest ToEditQuestionRequest(this QuestionResponse question)
        {
            EditQuestionRequest editQuestionRequest = new EditQuestionRequest()
            {
                Id          = question.Id,
                Title       = question.Title,
                Explanation = question.Explanation,
                ImageUrl    = question.ImageUrl,
                ThemeId     = question.ThemeId,
                Answers     = AnswerMapper.ToListUpdateAnswerRequest(question.Answers)
            };

            return(editQuestionRequest);
        }