public static MultipleChoiceOption MapFrom(this MultipleChoiceOptionDTO dto)
        {
            if (dto == null)
            {
                throw new Exception(ExceptionMessages.EntityNotFound);
            }

            return(new MultipleChoiceOption
            {
                Option = dto.OptionDescription,
                MultipleChoiceQuestionId = dto.MultipleChoiceQuestionId
            });
        }
Beispiel #2
0
        public static MultipleChoiceOptionViewModel MapFrom(this MultipleChoiceOptionDTO dto)
        {
            if (dto == null)
            {
                throw new Exception(ExceptionMessages.EntityNull);
            }

            return(new MultipleChoiceOptionViewModel
            {
                Id = dto.Id,
                OptionDescription = dto.OptionDescription,
                Answer = dto.Answer
            });
        }