Ejemplo n.º 1
0
        /// <summary>
        /// Returns all of the closed Pull Requests associated with the repository. Makes no distinction between merged and unmerged.
        /// </summary>
        /// <param name="stateFilter"></param>
        /// <returns></returns>
        public async Task <IList <PullRequest> > GetPullRequestsRootAsync(ItemState stateFilter)
        {
            var prOpts = new PullRequestRequest
            {
                State         = stateFilter.ToItemStateFilter(),
                SortProperty  = PullRequestSort.Created,
                SortDirection = SortDirection.Ascending,
            };
            var pullRequests = await _client.PullRequest.GetAllForRepository(_repoOwner, _repoName, prOpts);

            var reduced = pullRequests
                          .Select(FromPullRequest)
                          .ToList();

            return(reduced);
        }