private HttpResponseMessage CreateGithubIssuesFromQuery(GithubIssueQuery issueQuery, int currentpageIndex, List<GithubIssue> issues) { var requestUri = _requestBuilder.BuildRequestUri(issueQuery, currentpageIndex); var result = _httpClient.GetAsync(requestUri).Result; issues.AddRange(ConvertToGithubIssues(result)); return result; }
public virtual IEnumerable<GithubIssue> GetIssues(GithubIssueQuery issueQuery) { int currentpageIndex = 1; var issues = new List<GithubIssue>(); var result = CreateGithubIssuesFromQuery(issueQuery, currentpageIndex, issues); var lastPageIndex = _httpResponseHelper.GetLastPageIndex(result); for (currentpageIndex = 2; currentpageIndex <= lastPageIndex; currentpageIndex++) { CreateGithubIssuesFromQuery(issueQuery, currentpageIndex, issues); } return issues; }