示例#1
0
        public async Task <IActionResult> GetCountTrendingReposByLanguage(string language)
        {
            if (string.IsNullOrWhiteSpace(language))
            {
                return(BadRequest("Wrong param given"));
            }
            var countRepos = await _githubService.GetCountReposByLanguage(language);

            if (countRepos < 0)
            {
                return(BadRequest());
            }
            return(Ok(new
            {
                Language = language,
                NumberOfRepos = countRepos
            }));
        }