示例#1
0
        public async Task <Team> GetTeamById(int id, string userId)
        {
            var team = await _repository.GetById(id);

            if (team == null)
            {
                return(null);
            }

            var teamPlayers = await _playersRepository.GetAllByTeamId(id);

            team.Players = teamPlayers.ToList();
            return(team.ApplicationUserId == userId ? team : null);
        }
示例#2
0
        public async Task <ICollection <Player> > GetPlayersByTeamId(int teamId)
        {
            var teamPlayers = await _repository.GetAllByTeamId(teamId);

            return(teamPlayers);
        }