public RightPrediction GetRightPredictions()
        {
            var rightGamepredictionList = new List<RightGamePrediction>();
            var rightSecondRoundPredictionList = new List<RightSecondRoundPrediction>();

            var teams = db.Teams.ToList();
            var playedGames = db.Games.Where(g => g.Played == true).ToList();
            var gameGames = playedGames.Where(g => g.PredictionType_Id == PredictionType.Game).OrderBy(g=>g.sortId);
            var secondRoundGames =
                playedGames.Where(
                    g => g.PredictionType_Id != PredictionType.Game && g.PredictionType_Id != PredictionType.Table).ToList();

            var predictions = db.Predictions.ToList();
            var participants = db.Participants.ToList();

            #region

            foreach (var game in gameGames)
            {
                var points = Standen.GetMaxScoreForPredictionType(game.PredictionType_Id);

                var rightGamePredictions =
                    predictions.Where(
                        p =>
                        p.Game_Id == game.Id &&
                        p.Points ==
                        (points)).ToList();

                var participantList = new List<ParticipantView>();

                foreach (var rightGamePrediction in rightGamePredictions)
                {
                    var participant = participants.SingleOrDefault(
                        p => p.Id == rightGamePrediction.Participant_Id);

                    var participantLine = new ParticipantView
                                              {
                                                  Name = participant.Name,
                                                  ParticipantId = participant.Id
                                              };

                    participantList.Add(participantLine);

                }

                var orderedParticipantList = participantList.OrderBy(p => p.Name).ToList();

                var homeTeam = teams.SingleOrDefault(t => t.Id == game.HomeTeam_Id).Team1;
                var awayTeam = teams.SingleOrDefault(t => t.Id == game.AwayTeam_Id).Team1;

                var gameView = new GameView
                                   {
                                       AwayScore = game.AwayScore.ToString(),
                                       HomeScore = game.HomeScore.ToString(),
                                       HomeTeam = homeTeam,
                                       AwayTeam = awayTeam,
                                       GameId = game.Id,
                                       Played = (bool) game.Played,
                                       Date = game.Date.ToString(),
                                       SortId = (int) game.sortId

                                   };

                var firstRoundPrediction = new RightGamePrediction
                                               {
                                                   GameView = gameView,
                                                   Participants = orderedParticipantList
                                               };
                rightGamepredictionList.Add(firstRoundPrediction);
            }

            #endregion

            foreach (var game in secondRoundGames)
            {
                var points = Standen.GetMaxScoreForPredictionType(game.PredictionType_Id);

                var rightSecondRoundPredictions = predictions.Where(
                    p =>
                    p.Team_Id == game.Team_Id &&
                    p.PredictionType_Id == game.PredictionType_Id &&
                    p.Points ==
                    (points)).ToList();

                var participantList = new List<ParticipantView>();

                foreach (var rightSecondRoundPrediction in rightSecondRoundPredictions)
                {
                    var participant = participants.SingleOrDefault(
                        p => p.Id == rightSecondRoundPrediction.Participant_Id);

                    var participantLine = new ParticipantView
                                              {
                                                  Name = participant.Name,
                                                  ParticipantId = participant.Id
                                              };

                    participantList.Add(participantLine);
                }
                var orderedParticipantList = participantList.OrderBy(p => p.Name).ToList();

                var homeTeam = teams.SingleOrDefault(t => t.Id == game.Team_Id).Team1;
                var roundName = "";
                switch (game.PredictionType_Id)
                {
                    case PredictionType.QuarterFinals:
                        {
                            roundName = "in de kwartfinale";
                            break;
                        }

                    case PredictionType.SemiFinal:
                        {
                            roundName = "in de halve finale";
                            break;
                        }
                    case PredictionType.Final:
                        {
                            roundName = "in de finale";
                            break;
                        }
                    case PredictionType.Winner:
                        {
                            roundName = "als winnaar";
                            break;
                        }
                }

                var gameView = new GameView
                                   {
                                       HomeTeam = homeTeam,
                                     RoundName = roundName,

                                   };

                var secondRoundPrediction = new RightSecondRoundPrediction()
                                                {
                                                    GameView = gameView,
                                                    Participants = orderedParticipantList
                                                };
                rightSecondRoundPredictionList.Add(secondRoundPrediction);
            }

            var orderedFirstRoundPredicionts = rightGamepredictionList.OrderByDescending(r => r.GameView.SortId).ToList();
            var rightpredictions = new RightPrediction
                                       {
                                           FirstRoundRightPredictions = orderedFirstRoundPredicionts,
                                           SecondRoundPredictions = rightSecondRoundPredictionList
                                       };

            return rightpredictions;
        }
        public RightPrediction GetRightPredictions(int id)
        {
            var game = db.Games.SingleOrDefault(g => g.Id == id);
            var points = Standen.GetMaxScoreForPredictionType(game.PredictionType_Id);

            var rightPredictions =
                db.Predictions.Where(
                    p =>
                    p.Game_Id == game.Id &&
                    p.Points ==
                    (points));

            var participants = db.Participants.ToList();

            var participantList = new List<ParticipantView>();

            foreach (var rightPrediction in rightPredictions)
            {
                var participant = participants.SingleOrDefault(
                    p => p.Id == rightPrediction.Participant_Id);

                var participantLine = new ParticipantView
                                          {
                                              Name = participant.Name,
                                              ParticipantId = participant.Id
                                          };

                participantList.Add(participantLine);
            }

            var homeTeam = db.Teams.SingleOrDefault(t => t.Id == game.HomeTeam_Id).Team1;
            var awayTeam = db.Teams.SingleOrDefault(t => t.Id == game.AwayTeam_Id).Team1;

            var gameView = new GameView
                               {
                                   AwayScore =  game.AwayScore.ToString(),
                                   HomeScore =  game.HomeScore.ToString(),
                                   HomeTeam = homeTeam,
                                   AwayTeam = awayTeam,
                                   GameId = game.Id,
                                   Played = (bool) game.Played,
                                   Date =  game.Date.ToString()

                               };

            var rightPrediction1 = new RightPrediction
                                       {
                                           FirstRoundRightPredictions = new List<RightGamePrediction>
                                                                            {new RightGamePrediction
                                                                                      {

                                                                                          GameView = gameView,
                                                                                          Participants = participantList
                                                                                      }}
                                       };

            return rightPrediction1;
        }