Ejemplo n.º 1
0
        public Task<string> UpdateCommentAsync(string accessToken, string commentId, Comment updatedComment)
        {
            IDictionary<string, string> parameters = GetInitializedParameterCollection();
            parameters.Add(ReadmillConstants.AccessToken, accessToken);
            parameters.Add(CommentsClient.CommentId, commentId);

            WrappedComment wrappedUpdate = new WrappedComment();
            wrappedUpdate.Comment = updatedComment;

            var commentUrl = commentsUriTemplates[CommentsUriTemplateType.SingleComment].BindByName(this.readmillBaseUri, parameters);

            return PutAsync<WrappedComment>(wrappedUpdate, commentUrl);
        }
Ejemplo n.º 2
0
        public Task<string> PostHighlightCommentAsync(string accessToken, string highlightId, Comment comment)
        {
            IDictionary<string, string> parameters = GetInitializedParameterCollection();
            parameters.Add(ReadmillConstants.AccessToken, accessToken);
            parameters.Add(HighlightsClient.HighlightId, highlightId);

            //Wrap in InternalHighlight
            var wrappedComment = new WrappedComment() { Comment = comment };

            var commentUrl = highlightsUriTemplates[HighlightsUriTemplateType.HighlightComments].BindByName(this.readmillBaseUri, parameters);
            return PostAsync<WrappedComment>(wrappedComment, commentUrl);
        }