Exemple #1
0
        public List <TeamWithBoardsDTO> GetTeamsWithBoardsForUser(string userId)
        {
            var teams = _teamRepository.GetUserTeams(userId);

            var teamWithBoardsList = new List <TeamWithBoardsDTO>(teams.Count);

            teams.ForEach(team => {
                var boards         = _boardRepository.GetTeamBoards(team.Id);
                var teamWithBoards = new TeamWithBoardsDTO
                {
                    Team   = TeamFactory.createReturnMinimalDTO(team),
                    Boards = BoardFactory.createReturnDTOList(boards)
                };
                teamWithBoardsList.Add(teamWithBoards);
            });
            return(teamWithBoardsList);
        }