コード例 #1
0
        public IActionResult CheckBranches(GitHubInformationForm form, RequestTypes request)
        {
            IList <Branch> branches = new List <Branch>();
            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
                {
                    branches = _githubService.ProcessBranches(url);
                }
                catch (Exception ex)
                {
                    ViewBag.InnerException = ex.Message;
                }
            }
            return(PartialView("_Branches", branches));
        }