public void SaveCommentReply(int blogId, int commentId, CommentReplyModel reply)
        {
            BlogModel    blogToUpdate    = _blogPosts.First(x => x.Id == blogId);
            CommentModel commentToUpdate = blogToUpdate.Comments.First(x => x.Id == commentId);

            reply.Date = DateTime.Now;
            if (blogToUpdate.Comments != null)
            {
                commentToUpdate.Replies.Add(reply);
            }
            else
            {
                commentToUpdate.Replies = new List <CommentReplyModel> {
                    reply
                };
            }
            UpdateBlogPostsFile();
        }
示例#2
0
 public void SaveCommentReply(int id, int commentId, CommentReplyModel reply)
 {
     _blogRepository.SaveCommentReply(id, commentId, reply);
 }
示例#3
0
 public void Index(int id, int commentId, CommentReplyModel reply)
 {
     _blogService.SaveCommentReply(id, commentId, reply);
 }