public async Task <Comment> Create(CommentCreate create, User user)
        {
            Comment c = factory.Create(create, user);
            await repo.Add(c);

            await bus.Dispatch(new CommentCreateEvent(c));

            return(c);
        }
Exemple #2
0
 internal Comment(CommentCreate creationData, User user)
 {
     PostId       = creationData.PostId;
     Body         = creationData.Body;
     ParentId     = creationData.ParentId;
     CreationDate = DateTime.UtcNow;
     UserId       = user.Id;
     Votes        = new VoteStats();
 }
 public Comment Create(CommentCreate data, User user) => new Comment(data, user);