예제 #1
0
        private MeetingComment(
            MeetingId meetingId,
            MemberId authorId,
            string comment,
            MeetingCommentingConfiguration meetingCommentingConfiguration,
            MeetingCommentId inReplyToCommentId)
        {
            this.CheckRule(new CommentTextMustBeProvidedRule(comment));
            this.CheckRule(new CommentCanBeCreatedOnlyIfCommentingForMeetingEnabledRule(meetingCommentingConfiguration));

            this.Id    = new MeetingCommentId(Guid.NewGuid());
            _meetingId = meetingId;
            _authorId  = authorId;
            _comment   = comment;

            _inReplyToCommentId = inReplyToCommentId;

            _createDate = SystemClock.Now;
            _editDate   = null;

            _isRemoved       = false;
            _removedByReason = null;

            this.AddDomainEvent(new MeetingCommentCreatedDomainEvent(Id));
        }
        private MeetingMemberCommentLike(MeetingCommentId meetingCommentId, MemberId memberId)
        {
            Id = new MeetingMemberCommentLikeId(Guid.NewGuid());
            _meetingCommentId = meetingCommentId;
            _memberId         = memberId;

            this.AddDomainEvent(new MeetingCommentLikedDomainEvent(meetingCommentId, memberId));
        }
예제 #3
0
        private MeetingComment(MeetingId meetingId, MemberId authorId, string comment, MeetingCommentId?inReplyToCommentId)
        {
            this.CheckRule(new CommentTextMustBeProvidedRule(comment));

            this.Id    = new MeetingCommentId(Guid.NewGuid());
            _meetingId = meetingId;
            _authorId  = authorId;
            _comment   = comment;

            _inReplyToCommentId = inReplyToCommentId;

            _createDate = SystemClock.Now;
            _editDate   = null;

            this.AddDomainEvent(new MeetingCommentCreatedDomainEvent(Id));
        }
예제 #4
0
        public Task <int> CountMemberCommentLikesAsync(MemberId memberId, MeetingCommentId meetingCommentId)
        {
            var connection = _sqlConnectionFactory.GetOpenConnection();

            const string sql = "SELECT " +
                               "COUNT(*) " +
                               "FROM [meetings].[MeetingMemberCommentLikes] AS [Likes] " +
                               "WHERE [Likes].[MemberId] = @MemberId AND [Likes].[MeetingCommentId] = @MeetingCommentId";

            return(connection.QuerySingleAsync <int>(
                       sql,
                       new
            {
                memberId = memberId.Value,
                meetingCommentId = meetingCommentId.Value
            }));
        }
예제 #5
0
 public async Task <MeetingComment> GetByIdAsync(MeetingCommentId meetingCommentId)
 {
     return(await _meetingsContext.MeetingComments.FindAsync(meetingCommentId));
 }
예제 #6
0
 public async Task <MeetingMemberCommentLike> GetAsync(MemberId memberId, MeetingCommentId meetingCommentId)
 {
     return(await _meetingsContext.MeetingMemberCommentLikes.SingleOrDefaultAsync(l =>
                                                                                  EF.Property <MemberId>(l, "_memberId") == memberId &&
                                                                                  EF.Property <MeetingCommentId>(l, "_meetingCommentId") == meetingCommentId));
 }
 public MeetingCommentAddedDomainEvent(MeetingCommentId meetingCommentId, MeetingId meetingId, string comment)
 {
     MeetingCommentId = meetingCommentId;
     MeetingId        = meetingId;
     Comment          = comment;
 }
 public static MeetingMemberCommentLike Create(MeetingCommentId meetingCommentId, MemberId memberId)
 => new MeetingMemberCommentLike(meetingCommentId, memberId);
예제 #9
0
 public MeetingCommentCreatedDomainEvent(MeetingCommentId meetingCommentId)
 {
     MeetingCommentId = meetingCommentId;
 }
예제 #10
0
 public MeetingCommentEditedDomainEvent(MeetingCommentId meetingCommentId, string editedComment)
 {
     MeetingCommentId = meetingCommentId;
     EditedComment    = editedComment;
 }
 public MeetingCommentUnlikedDomainEvent(MeetingCommentId meetingCommentId, MemberId likerId)
 {
     MeetingCommentId = meetingCommentId;
     LikerId          = likerId;
 }
예제 #12
0
 public ReplyToMeetingCommentAddedDomainEvent(MeetingCommentId meetingCommentId, MeetingCommentId inReplyToCommentId, string reply)
 {
     MeetingCommentId   = meetingCommentId;
     InReplyToCommentId = inReplyToCommentId;
     Reply = reply;
 }
예제 #13
0
 public RemoveMeetingCommentCommand(MeetingCommentId meetingCommentId, string reason)
 {
     MeetingCommentId = meetingCommentId;
     Reason           = reason;
 }
 public MeetingCommentRemovedDomainEvent(MeetingCommentId meetingCommentId)
 {
     MeetingCommentId = meetingCommentId;
 }