public IEnumerable<Board> GenerateLeaderboard(string focusUserId, int focusCount)
        {
            var boards = new List<Board>();
            var boardNames = new string[] { "Victories", "Defeats", "GameCount" };
            int id = 0;

            using (var db = new StatisticsContext(this.NameOrConnectionString))
            {
                foreach (var boardName in boardNames)
                {
                    var board = new Board()
                    {
                        Id = ++id,
                        Name = boardName,
                        Scores = null
                    };

                    board.Scores = db.Database.SqlQuery<Score>(
                            "GenerateBoard @boardName, @count, @focusUserId",
                            new SqlParameter("boardName", boardName),
                            new SqlParameter("count", focusCount),
                            new SqlParameter("focusUserId", focusUserId)).ToArray();

                    boards.Add(board);
                }
            }

            return boards;
        }
        public Board GenerateLeaderboard(int focusCount)
        {
            int id = 0;
            var board = new Board()
            {
                Id = ++id,
                Name = "Victories",
                Scores = null
            };
            UserStats[] data = this.statsTable.Query.Take(focusCount).ToArray();
            board.Scores = new Score[data.Count()];
            int a = 0;
            foreach (UserStats stats in data)
            {
                board.Scores[a] = new Score()
                {
                    Id = ++a,
                    UserId = stats.UserId,
                    Victories = stats.Victories,
                    Defeats = stats.Defeats,
                    GameCount = stats.GameCount
                };
            }

            return board;
        }
        private void UpdateUserName(ref Board board)
        {
            foreach (var score in board.Scores)
            {
                if (string.IsNullOrEmpty(score.UserId))
                {
                    continue;
                }

                var profile = this.userRepository.GetUser(score.UserId);

                if (profile != null && !string.IsNullOrEmpty(profile.DisplayName))
                {
                    score.UserName = profile.DisplayName;
                }
                else 
                {
                    score.UserName = score.UserId;
                }
            }
        }