Changeset 80e2fe0


Ignore:
Timestamp:
11/02/21 21:03:24 (3 years ago)
Author:
Стојков Марко <mst@…>
Branches:
dev
Children:
2a9d9d1, b9d7ae5
Parents:
728eb31 (diff), 846cf1a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged feature/answer-question into dev

Location:
src/FinkiChattery
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/FinkiChattery/FinkiChattery.Commands/Questioning/QuestioningErrorCodes.cs

    r728eb31 r80e2fe0  
    1111        public const string AnswerAlreadyUpvoted = "AnswerAlreadyUpvoted";
    1212        public const string AnswerAlreadyDownvoted = "AnswerAlreadyDownvoted";
    13         public const string StudentHasBadReputation = "StudentHasBadReputation";
     13        public const string StudentHasBadReputation = "StudentHasBadReputation";
     14        public const string AnswerTextLengthInvalid = "AnswerTextLengthInvalid";
     15        public const string QuestionNotFound = "QuestionNotFound";
    1416    }
    1517}
  • src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/QuestioningFluentValidationRules.cs

    r728eb31 r80e2fe0  
    1616        }
    1717
     18        public static IRuleBuilderOptions<T, string> AnswerTextValidate<T>(this IRuleBuilder<T, string> ruleBuilder)
     19        {
     20            return ruleBuilder.NotNull().WithMessage(QuestioningErrorCodes.CantBeNull).MaximumLength(4000).WithMessage(QuestioningErrorCodes.AnswerTextLengthInvalid);
     21        }
     22
    1823        public static IRuleBuilderOptions<T, IEnumerable<U>> ListNotNull<T, U>(this IRuleBuilder<T, IEnumerable<U>> ruleBuilder)
    1924        {
  • src/FinkiChattery/FinkiChattery.Persistence/Models/Answer.cs

    r728eb31 r80e2fe0  
    66    public class Answer : BaseEntity
    77    {
     8        public Answer() : base()
     9        {
     10            CreatedOn = DateTime.UtcNow;
     11            VotesCount = 0;
     12            CorrectAnswer = false;
     13        }
     14
    815        public string Text { get; set; }
    916
Note: See TracChangeset for help on using the changeset viewer.