public async Task <IEnumerable <GamerInfo> > GetStatAsync(IRspStorage storage)
        {
            if (storage == null)
            {
                throw new ArgumentNullException(nameof(storage));
            }

            var usersFromStorage = await storage.GetUsersAsync();

            if (usersFromStorage == null)
            {
                return(null);
            }

            var users = usersFromStorage.Where(x => x.GamerInfo.Games > 10).OrderByDescending(x => x.GamerInfo.Games).Take(10).ToList();

            var result = new List <GamerInfo>();

            foreach (var user in users)
            {
                if (user.GamerInfo != null)
                {
                    result.Add(user.GamerInfo);
                }
            }

            return(result);
        }
 public StatisticController(IIndividualStatService individualStat, IGeneralStatService generalStat, IRspStorage storage, IRspStorage rspStorage)
 {
     _individualStat = individualStat;
     _generalStat    = generalStat;
     _storage        = storage;
     _rspStorage     = rspStorage;
 }
Esempio n. 3
0
 public AuthService(IJwtTokenGenerator manager, IRspStorage storage, PasswordHashGenerator hashGenerator)
 {
     _hashGenerator  = hashGenerator;
     _tokenGenerator = manager;
     _storage        = storage;
 }
Esempio n. 4
0
 public SeriesService(IIndividualStatService individualStatService, IRspStorage storage)
 {
     _individualStatService = individualStatService;
     _storage = storage;
     _rounds  = new List <Round>();
 }