コード例 #1
0
        public async Task <IActionResult> ContributorsInformation(string repo, string userName, int count)
        {
            var outModel = await _gitHubRepository.GetRecentContributors(_gitHubConfiguration.RepositoryCsv);

            if (!string.IsNullOrEmpty(repo))
            {
                outModel.First(i => i.Repository.Equals(repo, StringComparison.InvariantCultureIgnoreCase))
                .TopWeekContributors.Add(new GitHubContributor
                {
                    Author  = userName,
                    Commits = count
                });
            }

            var newsPosts = await GetNewsFromDiscoverDotNet();

            var outViewModel = new TickerViewModel()
            {
                GitHubInformation = outModel.ToArray(),
                News = newsPosts
            };

            ViewBag.Configuration = _gitHubConfiguration;

            return(View($"contributor_{_gitHubConfiguration.DisplayMode}", outViewModel));
        }
コード例 #2
0
        public async Task <IActionResult> ContributorsInformation(string repo, string userName, int count)
        {
            var outModel = await _githubRepository.GetRecentContributors(_githubConfiguration.RepositoryCsv);

            if (!string.IsNullOrEmpty(repo))
            {
                outModel.First(i => i.Repository.Equals(repo, StringComparison.InvariantCultureIgnoreCase)).TopWeekContributors.Add(new GitHubContributor
                {
                    Author  = userName,
                    Commits = count
                });
            }
            //Viewbag.Configuration = _githubConfiguration;
            return(Ok($"contributor {_githubConfiguration.DisplayMode} {outModel.ToArray()}"));
        }