示例#1
0
        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);
        }
示例#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();
 }
示例#3
0
 public Comment Create(CommentCreate data, User user) => new Comment(data, user);