コード例 #1
0
        public static QuestionAnswersSummary ToQuestionAnswerSummary(this ClientModels.QuestionAnswersSummary questionAnswersSummary)
        {
            if (questionAnswersSummary == null)
            {
                throw new ArgumentNullException(nameof(questionAnswersSummary));
            }

            return(new QuestionAnswersSummary()
            {
                QuestionText = questionAnswersSummary.QuestionText,
                QuestionType = (QuestionType)Enum.Parse(typeof(QuestionType), questionAnswersSummary.QuestionType.ToString()),
                AnswersSummary = questionAnswersSummary.AnswersSummary,
                PossibleAnswers = questionAnswersSummary.PossibleAnswers
            });
        }
コード例 #2
0
        internal static QuestionAnswersSummary ToQuestionAnswersSummary(
            this ClientModels.QuestionAnswersSummary questionAnswersSummary)
        {
            if (questionAnswersSummary == null)
            {
                throw new ArgumentException(nameof(questionAnswersSummary));
            }

            return(new QuestionAnswersSummary()
            {
                AnswersSummary = questionAnswersSummary.AnswersSummary,
                PossibleAnswers = questionAnswersSummary.PossibleAnswers,
                QuestionText = questionAnswersSummary.QuestionText,
                QuestionType = (QuestionType)questionAnswersSummary.QuestionType
            });
        }