コード例 #1
0
        public IActionResult CheckRepository(GitHubInformationForm form, RequestTypes request)
        {
            Repository repositoryInformation = null;
            var        url = string.Empty;

            if (!string.IsNullOrEmpty(form.UserName) && !string.IsNullOrEmpty(form.RepositoryName))
            {
                var gihubSettings = new GitHubSettings {
                    UserName = form.UserName, RepositoryName = form.RepositoryName, RequestType = request
                };
                url = _urlGenerator.GenerateUrlForGitHubApi(gihubSettings);
                try
                {
                    repositoryInformation = _githubService.ProcessRepositoryInfoByUrl(url);
                }
                catch (Exception ex)
                {
                    ViewBag.InnerException = ex.Message;
                }
            }

            return(PartialView("_Repository", repositoryInformation));
        }