public async Task <ActionResult <CommentMoveResult> > MoveComment(
            string toOwnerName, string toRepoName,
            [FromBody] CommentMoveRequest commentMoveRequest)
        {
            var accessToken = await HttpContext.GetTokenAsync("access_token");

            var gitHub = GitHubUtils.GetGitHubClient(accessToken);

            try
            {
                await gitHub.Issue.Comment.Create(toOwnerName, toRepoName, commentMoveRequest.IssueNumber, commentMoveRequest.Text);

                return(Ok(
                           new CommentMoveResult
                {
                }));
            }
            catch (Exception ex)
            {
                return(BadRequest(
                           new CommentMoveResult
                {
                    Exception = ex,
                }));
            }
        }
Exemple #2
0
        public async Task <ActionResult <CommentMoveResult> > MoveComment(
            string toOwnerName, string toRepoName,
            [FromBody] CommentMoveRequest commentMoveRequest)
        {
            try
            {
                var commentMoveResult = await IssueMoverService.MoveComment(toOwnerName, toRepoName, commentMoveRequest);

                return(Ok(commentMoveResult));
            }
            catch (Exception ex)
            {
                return(BadRequest(
                           new CommentMoveResult
                {
                    ExceptionMessage = ex.Message,
                    ExceptionStackTrace = ex.StackTrace,
                }));
            }
        }
        public async Task <CommentMoveResult> MoveComment(string destinationOwner, string destinationRepo, CommentMoveRequest commentMoveRequest)
        {
            var gitHub = await GitHubAccessor.GetGitHubClient();

            await gitHub.Issue.Comment.Create(destinationOwner, destinationRepo, commentMoveRequest.IssueNumber, commentMoveRequest.Text);

            return(new CommentMoveResult
            {
            });
        }
 public async Task <CommentMoveResult> MoveComment(string destinationOwner, string destinationRepo, CommentMoveRequest commentMoveRequest)
 {
     return(await Http.PostJsonAsync <CommentMoveResult>($"https://localhost:44347/api/movecomment/{destinationOwner}/{destinationRepo}", commentMoveRequest));
 }