/// <summary> /// Creates a new comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns>The id of the newly created comment.</returns> public int NewComment(Comment comment) { var comment_put = new Comment_Put(); CopyPropertyValues(comment, comment_put); return(WordPressService.NewComment(WordPressSiteConfig.BlogId, WordPressSiteConfig.Username, WordPressSiteConfig.Password, Convert.ToInt32(comment.PostId), comment_put)); }
/// <summary> /// Asynchronously creates a new comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns>The id of the newly created comment.</returns> public async Task <int> NewCommentAsync(Comment comment) { var comment_put = new Comment_Put(); CopyPropertyValues(comment, comment_put); return(await Task.Factory.FromAsync ( WordPressService.BeginNewComment(WordPressSiteConfig.BlogId, WordPressSiteConfig.Username, WordPressSiteConfig.Password, Convert.ToInt32(comment.PostId), comment_put), WordPressService.EndNewComment )); }