private static bool IsQuestionValid(CreateQuestionCmd question) { if (question.Body.Length <= 1000) { if (question.Tags.Length >= 1 && question.Tags.Length <= 3) { return(true); } } return(false); }
public static Result <InvalidateQuestion> Create(CreateQuestionCmd question) { if (IsQuestionValid(question)) { return(new InvalidateQuestion(question)); } else { return(new Result <InvalidateQuestion>(new InvalidQuestion(question))); } }
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") { }