async Task <IEnumerable <Model.Repository> > GetRepositoriesAsync()
        {
            IEnumerable <string> repos;

            try
            {
                var result = await dockerDistribution.GetRepositoryListAsync(AuthHandler.CatalogScope());

                repos = result.Repositories;
            }
            catch (ApiException ex)
            {
                if (ex.StatusCode == System.Net.HttpStatusCode.Unauthorized)
                {
                    repos = Array.Empty <string>();
                }
                else
                {
                    throw;
                }
            }

            var tasks = repos.Union(Config.Repositories)
                        .Distinct()
                        .Select(r => GetRepositoryAsync(r))
                        .ToArray();

            Task.WaitAll(tasks);

            return(tasks
                   .Where(t => t.IsCompletedSuccessfully)
                   .Select(t => t.Result)
                   .Where(t => t.Tags > 0));
        }
 public IEnumerable <Model.Repository> GetRepositories() =>
 ExecAsync(AuthHandler.CatalogScope(), CatalogKey(), () => Task.FromResult(innerClient.GetRepositories())).Result;