public void CalculatePlayerStatistics(GameType gameId, List <Player> players) { if (players.Count > 0) { // All summary records var playerSummaries = _statisticsRepository.GetForPlayers(players.Where(m => m.Scores.Any()).ToList()). Select(m => m.Value); var statistics = CalculateStatisticsHelper(gameId, playerSummaries, players); _statisticsRepository.Add(statistics.ToList()); _statisticsRepository.SaveAll(); } }