/// <summary> /// Create a comment using the specified parameters. /// </summary> /// <param name="parameters">Parameters.</param> /// <returns>Comment created.</returns> private async Task <CommentModel> CreateCommentByParameters(CommentJsonForProject parameters) { RestResponse result = await _callerRestApiTodoist.CallRestMethodAsync(Method.Post, "comments", Guid.NewGuid().ToString(), null, parameters); if (result.StatusCode == System.Net.HttpStatusCode.OK && result.ContentType == "application/json") { return(JsonConvert.DeserializeObject <CommentModel>(result.Content)); } return(null); }
/// <summary> /// Create a comment for a project. /// </summary> /// <param name="commentContent">Content of the comment.</param> /// <param name="projectID">Project identifier.</param> /// <returns>Comment created.</returns> public async Task <CommentModel> CreateCommentForProjectAsync(string commentContent, long projectID) { var parameters = new CommentJsonForProject(projectID, commentContent); return(await CreateCommentByParameters(parameters)); }