public CommentLikedEvent(IValueCommentAggregateChildDataModel model) : base(model, CommentAggConstants.EventType.CommentLiked, typeof(CommentLikedEvent).AssemblyQualifiedName) { this.ParentId = model.ParentId; }
public ValueCommentAggregateChild AddComment(IValueCommentAggregateChildDataModel model, bool applyEvent = true) { var comment = new ValueCommentAggregateChild(this, model.Id); comment.AddComment(model, applyEvent); return(comment); }
public CommentAddedEvent(IValueCommentAggregateChildDataModel model) : base(model, CommentAggConstants.EventType.CommentAdded, typeof(CommentAddedEvent).AssemblyQualifiedName) { this.ParentId = model.ParentId; this.CommentText = model.CommentText; this.Likes = model.Likes; this.Dislikes = model.Dislikes; this.UserName = model.UserName; }
public CommentViewModel ToViewModel(IValueCommentAggregateChildDataModel comment) { return(new CommentViewModel { Id = comment.Id, UserName = new DtoProp <string>(comment.UserName), ParentVersion = new DtoProp <long?>(comment.ParentVersion), ParentId = comment.ParentId, TenantId = new DtoProp <int?>(comment.TenantId), CommentText = new DtoProp <string>(comment.CommentText), Dislikes = new DtoProp <int?>(comment.Dislikes), Likes = new DtoProp <int?>(comment.Likes) }); }
public void AddComment(IValueCommentAggregateChildDataModel model, bool applyEvent = true) { // when a comment is first added, we don't need to fire individual events ChangeCommentText(model.CommentText, applyEvent: false); ChangeCommentUser(model.UserName, applyEvent: false); ChangeTenantId(model.TenantId); if (!applyEvent) { return; } ApplyEvent(CommentEventTypes.CommentAdded); }