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)); }
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)); }
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 })); }
public async Task <MeetingComment> GetByIdAsync(MeetingCommentId meetingCommentId) { return(await _meetingsContext.MeetingComments.FindAsync(meetingCommentId)); }
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);
public MeetingCommentCreatedDomainEvent(MeetingCommentId meetingCommentId) { MeetingCommentId = meetingCommentId; }
public MeetingCommentEditedDomainEvent(MeetingCommentId meetingCommentId, string editedComment) { MeetingCommentId = meetingCommentId; EditedComment = editedComment; }
public MeetingCommentUnlikedDomainEvent(MeetingCommentId meetingCommentId, MemberId likerId) { MeetingCommentId = meetingCommentId; LikerId = likerId; }
public ReplyToMeetingCommentAddedDomainEvent(MeetingCommentId meetingCommentId, MeetingCommentId inReplyToCommentId, string reply) { MeetingCommentId = meetingCommentId; InReplyToCommentId = inReplyToCommentId; Reply = reply; }
public RemoveMeetingCommentCommand(MeetingCommentId meetingCommentId, string reason) { MeetingCommentId = meetingCommentId; Reason = reason; }
public MeetingCommentRemovedDomainEvent(MeetingCommentId meetingCommentId) { MeetingCommentId = meetingCommentId; }