Пример #1
0
        internal static Tailspin.Web.Shared.Models.QuestionType ToQuestionType(this ClientModels.QuestionType questionType)
        {
            Tailspin.Web.Shared.Models.QuestionType result;
            switch (questionType)
            {
            case ClientModels.QuestionType.FiveStars:
                result = Tailspin.Web.Shared.Models.QuestionType.FiveStars;
                break;

            case ClientModels.QuestionType.MultipleChoice:
                result = Tailspin.Web.Shared.Models.QuestionType.MultipleChoice;
                break;

            case ClientModels.QuestionType.SimpleText:
                result = Tailspin.Web.Shared.Models.QuestionType.SimpleText;
                break;

            default:
                throw new ArgumentException($"Invalid question type: {questionType}");
            }

            return(result);
        }
Пример #2
0
 private static string ToQuestionType(this ClientModels.QuestionType questionType)
 {
     return(Enum.GetName(typeof(ClientModels.QuestionType), questionType));
 }