コード例 #1
0
        public async Task UpdateReplyAsync(SaveReplyModel model, Guid replyId)
        {
            var updateReplyModel = new UpdateReplyModel
            {
                Id      = replyId,
                Content = model.Content,
            };

            await _replyManager.UpdateReplyAsync(updateReplyModel);
        }
コード例 #2
0
        public async Task <Guid> AddReply(Guid commentId, SaveReplyModel model)
        {
            ArgumentGuard.NotEmpty(commentId, nameof(commentId));
            ArgumentGuard.NotNull(model, nameof(model));

            var comment = await _commentService.GetCommentAsync(commentId);

            // permission
            return(await _replyService.AddReplyAsync(commentId, model));
        }
コード例 #3
0
ファイル: ReplyService.cs プロジェクト: seun035/BloggApp
        public async Task <Guid> AddReplyAsync(Guid commentId, SaveReplyModel model)
        {
            ArgumentGuard.NotEmpty(commentId, nameof(commentId));
            ArgumentGuard.NotNull(model, nameof(model));

            // validation,

            var replyEntity = new ReplyEntity
            {
                AuthorId       = _userContext.UserId,
                CommentId      = commentId,
                Content        = model.Content,
                CreatedDateUtc = DateTime.UtcNow
            };

            return(await _replyRepository.AddAsync(replyEntity));
        }
コード例 #4
0
 public Task UpdateReply(Guid replyId, [FromBody] SaveReplyModel saveReplyModel)
 {
     return(_replyComposerService.UpdateReplyAsync(saveReplyModel, replyId));
 }
コード例 #5
0
 public async Task <Guid> AddReply(Guid commentId, [FromBody] SaveReplyModel saveReplyModel)
 {
     return(await _replyManager.AddReply(commentId, saveReplyModel));
 }