public async Task <Option <UserStatistics, RepoCounterApiException> > GetRepositoryStatisticsAsync(string username)
        {
            var option = await _innerService.GetRepositoryStatisticsAsync(username);

            option.MatchSome(Transform);
            return(option);
        }
Exemplo n.º 2
0
        public async Task <ActionResult <UserStatistics> > GetRepositoriesStatistics(string username)
        {
            var response = await _repoStatisticsService.GetRepositoryStatisticsAsync(username);

            return(response.Match(
                       statistics => Ok(statistics),
                       error => _errorMapper.GetUserFriendlyError(error)));
        }
        public async Task <Option <UserStatistics, AllegroApiException> > GetRepositoryStatisticsAsync(string username)
        {
            var input = await _innerService.GetRepositoryStatisticsAsync(username);

            input.Map(stats => stats.Letters = stats.Letters
                                               .OrderBy(x => x.Key)
                                               .ToDictionary(x => x.Key, x => x.Value));
            return(input);
        }