Exemplo n.º 1
0
 public CreateQuestionCMD(CreateQuestionCMD question)
 {
     Title          = question.Title;
     QuestionText   = question.QuestionText;
     Autor          = question.Autor;
     Tags           = question.Tags;
     ProfanityCheck = question.ProfanityCheck;
     // Votes = new List<VoteEnum>();
 }
Exemplo n.º 2
0
 private static string IsQuestionValid(CreateQuestionCMD question)
 {
     if (question.QuestionText.Length > 10000)
     {
         return("Question too long!");
     }
     if (question.Tags.Length == 0 || question.Tags.Length > 3)
     {
         return("Invalid number of tags");
     }
     return("Valid");
 }
Exemplo n.º 3
0
            public static Result <UnvalidatedQuestion> Create(CreateQuestionCMD question)
            {
                string msg;

                if ((msg = IsQuestionValid(question)).Equals("Valid"))
                {
                    return(new UnvalidatedQuestion(question));
                }
                else
                {
                    return(new Result <UnvalidatedQuestion>(new InvalidQuestionException(msg)));
                }
            }
Exemplo n.º 4
0
 public UnvalidatedQuestion(CreateQuestionCMD question)
 {
     Question = question;
 }