コード例 #1
0
        public async Task <IActionResult> UpdateComment([FromBody] IdeaCommentDto comment)
        {
            comment.OwnerId = _userIdentityProvider.GetUserId();
            await _ideaCommentService.UpdateAsync(comment);

            return(Json(new { message = "Comment updated successfully" }));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public Task <IdeaCommentDto> CreateAsync(IdeaCommentDto comment)
        {
            var command = new CreateIdeaCommentCommand(comment);

            _bus.SendCommand(command);

            return(GetCommentAsync(command.Comment.Id));
        }
コード例 #4
0
 public IdeaCommentDeletedEvent(IdeaCommentDto ideaComment)
 {
     Comment = ideaComment;
 }
コード例 #5
0
 public IdeaCommentCreatedEvent(IdeaCommentDto ideaComment)
 {
     Comment = ideaComment;
 }
コード例 #6
0
 public IdeaCommentUpdatedEvent(IdeaCommentDto ideaComment)
 {
     Comment = ideaComment;
 }
コード例 #7
0
 public UpdateIdeaCommentCommand(IdeaCommentDto comment)
 {
     Comment= comment;
 }
コード例 #8
0
        public Task UpdateAsync(IdeaCommentDto comment)
        {
            var command = new UpdateIdeaCommentCommand(comment);

            return(_bus.SendCommand(command));
        }
コード例 #9
0
 public CreateIdeaCommentCommand(IdeaCommentDto comment)
 {
     Comment = comment;
 }