internal PullRequestManager(Models.GitHub.PullRequest pullRequest, PullRequestData data) { PullRequest = pullRequest; this.data = data; ReviewRepository = new ReviewRepository(data); CommentRepository = new CommentRepository(data); }
public async Task <PullRequestManager> GetExistPullRequestManagerAsync(string repName, int pullRequestNumber) { var owner = (await client.User.Current()).Login; var data = new PullRequestData(client, owner, repName, pullRequestNumber); var pullRequest = await GetPullRequestAsync(data); return(new PullRequestManager(pullRequest, data)); }
private async Task <Models.GitHub.PullRequest> GetPullRequestAsync(PullRequestData data) { var pullRequest = await client?.PullRequest.Get(data.owner, data.repName, data.pullRequestNumber); var commits = await client?.PullRequest.Commits(data.owner, data.repName, data.pullRequestNumber); var reviewRep = new ReviewRepository(data); var reviews = await reviewRep.GetAllReviewAsync(); return(pullRequest.ToPullRequest(commits.ToCommits(), reviews, data.repName)); }
internal ReviewRepository(PullRequestData data) { this.data = data; }
internal CommentRepository(PullRequestData data) { this.data = data; }