Exemple #1
0
        public async Task <IActionResult> TypedClient2()
        {
            GitHubRepo gitHubRepo = new GitHubRepo();

            try
            {
                var repos = await _repoService.GetRepos();

                gitHubRepo.GetRepoRequestsError = false;
                gitHubRepo.RepoRequests         = repos;
            }
            catch (HttpRequestException ex)
            {
                gitHubRepo.GetRepoRequestsError = true;
                gitHubRepo.RepoRequests         = Array.Empty <string>();
            }
            return(View(gitHubRepo));
        }