Ejemplo n.º 1
0
            public async Task <TeamDetailsDto> Handle(GetTeamDetailsQuery request, CancellationToken cancellationToken = default)
            {
                var teamDto = await _dbContext.Teams
                              .AsNoTracking()
                              .Where(t => t.Id == request.TeamId)
                              .ProjectTo <TeamDetailsDto>(_mapper.ConfigurationProvider)
                              .SingleOrDefaultAsync(cancellationToken);

                if (teamDto != null)
                {
                    teamDto.IsCurrentUserTeam = await _currentUserService.GetTeamIdAsync() == request.TeamId;
                }

                return(teamDto);
            }