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(); }
public void SaveCommentReply(int id, int commentId, CommentReplyModel reply) { _blogRepository.SaveCommentReply(id, commentId, reply); }
public void Index(int id, int commentId, CommentReplyModel reply) { _blogService.SaveCommentReply(id, commentId, reply); }