public async IAsyncEnumerable <IEnumerable <Repository> > GetRepositories(string repositoryOwner, GitHubToken authorizationToken, [EnumeratorCancellation] CancellationToken cancellationToken, int numberOfRepositoriesPerRequest = 100) { RepositoryConnection?repositoryConnection = null; do { repositoryConnection = await GetRepositoryConnection(repositoryOwner, repositoryConnection?.PageInfo?.EndCursor, authorizationToken, cancellationToken, numberOfRepositoriesPerRequest).ConfigureAwait(false); yield return(repositoryConnection?.RepositoryList ?? Enumerable.Empty <Repository>()); }while (repositoryConnection?.PageInfo?.HasNextPage is true); }
public async Task <Repository> GetRepository(string repositoryOwner, string repositoryName, GitHubToken authorizationToken, CancellationToken cancellationToken) { var response = await GitHubApiClient.RepositoryQuery(new RepositoryQueryContent(repositoryOwner, repositoryName), GetGitHubBearerTokenHeader(authorizationToken), cancellationToken).ConfigureAwait(false); return(response.Data.Repository); }