public async Task <IActionResult> UpdateComment([FromBody] IdeaCommentDto comment)
        {
            comment.OwnerId = _userIdentityProvider.GetUserId();
            await _ideaCommentService.UpdateAsync(comment);

            return(Json(new { message = "Comment updated successfully" }));
        }
        public async Task <IdeaCommentDto> CreateComment(string ideaId, [FromBody] IdeaCommentDto comment)
        {
            comment.IdeaId  = ideaId;
            comment.OwnerId = _userIdentityProvider.GetUserId();
            var createdComment = await _ideaCommentService.CreateAsync(comment);

            return(await _ideaCommentService.GetCommentAsync(createdComment.Id));
        }
        public Task <IdeaCommentDto> CreateAsync(IdeaCommentDto comment)
        {
            var command = new CreateIdeaCommentCommand(comment);

            _bus.SendCommand(command);

            return(GetCommentAsync(command.Comment.Id));
        }
Ejemplo n.º 4
0
 public IdeaCommentDeletedEvent(IdeaCommentDto ideaComment)
 {
     Comment = ideaComment;
 }
Ejemplo n.º 5
0
 public IdeaCommentCreatedEvent(IdeaCommentDto ideaComment)
 {
     Comment = ideaComment;
 }
 public IdeaCommentUpdatedEvent(IdeaCommentDto ideaComment)
 {
     Comment = ideaComment;
 }
Ejemplo n.º 7
0
 public UpdateIdeaCommentCommand(IdeaCommentDto comment)
 {
     Comment= comment;
 }
        public Task UpdateAsync(IdeaCommentDto comment)
        {
            var command = new UpdateIdeaCommentCommand(comment);

            return(_bus.SendCommand(command));
        }
 public CreateIdeaCommentCommand(IdeaCommentDto comment)
 {
     Comment = comment;
 }