Пример #1
0
        public IEnumerable <HockeyPlayer> GetHockeyPlayers(int count, int startIndex = 0)
        {
            if (_hockeyPlayers.IsEmpty())
            {
                _hockeyPlayers = _hockeyPlayerService.GetHockeyPlayers().ToList();
            }

            var actualCount = _hockeyPlayers.Count();
            var result      = new List <HockeyPlayer>();

            // Generate dupes since we don't have a large data set
            for (int i = startIndex % actualCount; i < count + startIndex; i++)
            {
                result.Add(_hockeyPlayers[i % actualCount]);
            }

            return(result);
        }