Exemple #1
0
 private static bool IsQuestionValid(CreateQuestionCmd question)
 {
     if (question.Body.Length <= 1000)
     {
         if (question.Tags.Length >= 1 && question.Tags.Length <= 3)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
 public static Result <InvalidateQuestion> Create(CreateQuestionCmd question)
 {
     if (IsQuestionValid(question))
     {
         return(new InvalidateQuestion(question));
     }
     else
     {
         return(new Result <InvalidateQuestion>(new InvalidQuestion(question)));
     }
 }
Exemple #3
0
 private InvalidateQuestion(CreateQuestionCmd question)
 {
     Question = question;
 }
 public InvalidQuestion(CreateQuestionCmd question) : base($"You reached the maximum length of 1000 characters in body or you have more than 3 tags")
 {
 }