public async Task OnGet()
        {
            var matchStats = await _stat.GetAll();

            var players = await _player.GetAll();

            foreach (var player in players)
            {
                try
                {
                    var playerStats = await _stat.GetStatsByPlayerId(player.Id);

                    var statisticDetail = new StatisticDetail();

                    var totalStats = _stat.GetTotalStats(playerStats);

                    var matchCount = _stat.GetMatchCount(playerStats);

                    var perMatchStats = _stat.GetPerMatchStats(totalStats, playerStats);

                    statisticDetail.Player             = player;
                    statisticDetail.MatchCount         = matchCount;
                    statisticDetail.TotalStatDetail    = totalStats;
                    statisticDetail.PerMatchStatDetail = perMatchStats;

                    statisticDetail.MatchForms = _stat.GetMatchFormsByPlayerId(matchStats, player.Id);

                    statisticDetail.WinRatio = _stat.GetWinRatioByMatchForms(statisticDetail.MatchForms);

                    statisticDetail.LooseRatio = _stat.GetLooseRatioByMatchForms(statisticDetail.MatchForms);

                    statisticDetail.PenaltyRatio = _stat.GetPenaltyRatio(totalStats.PenaltyScore, totalStats.MissedPenalty);

                    statisticDetail.TotalGoal            = _stat.GetTotalGoal(totalStats.Goal, totalStats.PenaltyScore);
                    statisticDetail.PerMatchPositionGoal = _stat.GetPerMatchPositionalGoal(totalStats.Goal, matchCount);
                    statisticDetail.PerMatchTotalGoal    = _stat.GetPerMatchTotalGoal(statisticDetail.TotalGoal, matchCount);

                    StatisticDetailInfo.Add(statisticDetail);
                }
                catch (Exception)//Oyuncuya ait istatistik yoksa
                {
                }
            }

            StatisticInfo = new Statistic(StatisticDetailInfo);
        }
        public async Task OnGet(int id)
        {
            var playerId = id;

            var player = await _player.GetById(playerId);

            PlayerDetailInfo.Player = player;

            var playerStats = await _stat.GetStatsByPlayerId(playerId);

            playerStats = playerStats.OrderBy(p => p.Match.MatchDate).ThenBy(p => p.Match.Order).ThenBy(p => p.Team.Id).ToList();

            var totalStats = _stat.GetTotalStats(playerStats);

            var perMatchStats = _stat.GetPerMatchStats(totalStats, playerStats);

            PlayerDetailInfo.PenaltyRatio = _stat.GetPenaltyRatio(totalStats.PenaltyScore, totalStats.MissedPenalty);

            PlayerDetailInfo.TotalStats    = totalStats;
            PlayerDetailInfo.PerMatchStats = perMatchStats;

            var allMatchStats = await _stat.GetAll();

            PlayerDetailInfo.MatchForms  = _stat.GetMatchFormsByPlayerId(allMatchStats, playerId);
            PlayerDetailInfo.TotalWins   = _stat.GetTotalWinsByMatchForms(PlayerDetailInfo.MatchForms);
            PlayerDetailInfo.TotalLooses = _stat.GetTotalLoosesByMatchForms(PlayerDetailInfo.MatchForms);
            PlayerDetailInfo.WinRatio    = _stat.GetWinRatioByMatchForms(PlayerDetailInfo.MatchForms);
            PlayerDetailInfo.LooseRatio  = _stat.GetLooseRatioByMatchForms(PlayerDetailInfo.MatchForms);

            foreach (var stat in playerStats)
            {
                var playerStatDetail = new PlayerStatDetail
                {
                    PlayerStat = stat,
                    MatchStats = await _stat.GetStatsByMatchId(stat.MatchId)
                };

                playerStatDetail.HomeTeamScore = _stat.GetScoreByStatsAndTeamId(playerStatDetail.MatchStats, stat.Match.HomeTeamId, stat.Match.AwayTeamId);
                playerStatDetail.AwayTeamScore = _stat.GetScoreByStatsAndTeamId(playerStatDetail.MatchStats, stat.Match.AwayTeamId, stat.Match.HomeTeamId);

                PlayerDetailInfo.PlayerStats.Add(playerStatDetail);
            }
        }