I'll assume you want the strongest predictions, i.e., the games where the most people agree on the outcome.
var predictions = db.Predictions
.GroupBy( g => g.gameId )
.Select( g => new
{
gameId = g.Key,
homeWin = g.Sum( h => h.homeWin ),
awayWin = g.Sum( a => a.awayWin ),
draw = g.Sum( d => d.draw )
})
.Select( g => new
{
gameId = g.gameId,
prediction = g.homeWin > g.awayWin
? (g.homeWin > draw
? 'homeWin'
: 'draw')
: (g.awayWin > g.draw
? 'awayWin'
: 'draw'),
strength = g.homeWin > g.awayWin
? (g.homeWin > draw
? g.homeWin
: g.draw)
: (g.awayWin > g.draw
? g.awayWin
: g.draw)
})
.OrderByDescending( g => g.strength )
.Take(3);
You might be able to combine the two selects, but IMO it would hurt the readability of the code.