예제 #1
0
        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);
        }
예제 #2
0
 public Team GetTeam(int id)
 {
     return(_mongoTeamProvider.Get(id).Result);
 }