Exemplo n.º 1
0
        public (Squad Squad, IEnumerable <Player> Players, Coach Coach) GetFullSquadDetails(Guid squadId)
        {
            var squad   = GetSquad(squadId);
            var players = memberQuery.GetPlayers(squadId);
            var coach   = memberQuery.GetSquadCoaches(squadId);

            return(squad, players, coach.FirstOrDefault());
        }
Exemplo n.º 2
0
        private List <SelectListItem> GetSquadPlayersForEvent(Event @event)
        {
            List <SelectListItem> playerList = new List <SelectListItem>();

            foreach (var squad in @event.Squads)
            {
                var players = memberQuery.GetPlayers(squad.Guid);
                playerList.AddRange(players.Select(p => new SelectListItem {
                    Value = p.Email, Text = $"{p.FirstName} {p.LastName}: {p.Email}"
                }));
            }

            return(playerList.OrderBy(s => s.Text).ToList());
        }