Example #1
0
        private async Task <BoardDto> GetBoardAsync()
        {
            BoardBo boardBo = await _taskService.GetBoardAsync(BOARD_ID);

            BoardDto boardDto = _mapper.Map <BoardDto>(boardBo);

            boardDto.Tasks = _mapper.Map <List <TaskDto> >(boardBo.Statuses.SelectMany(s => s.Tasks));
            return(boardDto);
        }
Example #2
0
        public async Task <BoardBo> GetBoardAsync(int boardId)
        {
            Board board = await _dbContext
                          .Boards
                          .Include(b => b.Statuses)
                          .ThenInclude(s => s.Tasks)
                          .FirstOrDefaultAsync(b => b.Id == boardId);

            BoardBo boardBo = _mapper.Map <BoardBo>(board);

            return(boardBo);
        }