public IEnumerable <Player> GetPlayersForTeam(int teamId) { var team = _mongoTeamProvider.Get(teamId).Result; var teamPlayers = new List <Player>(); if (team?.Players != null && team.Players.Any()) { foreach (var playerId in team.Players) { teamPlayers.Add(GetPlayer(playerId)); } } teamPlayers = teamPlayers.OrderBy(x => x.Position).ThenByDescending(x => x.TotalPoints).ToList(); return(teamPlayers); }
public Team GetTeam(int id) { return(_mongoTeamProvider.Get(id).Result); }