public async Task <ResponseModel <TrainerUserDetailModel> > Handle(GetTrainerUserDetailQuery request, CancellationToken cancellationToken) { var redisKey = $"TrainerUsersWithDepartmentsByTenantId{request.TenantId}"; var redisTrainerUsers = await _cacheService.RedisCacheAsync(redisKey, _ => _context.TrainerUsers .AsNoTracking() .Include(x => x.Department) .Where(x => x.Department.TenantId == request.TenantId) , cancellationToken); var trainerUser = redisTrainerUsers.FirstOrDefault(x => x.Id == request.Id); if (trainerUser is null) { throw new NotFoundException(nameof(TrainerUser), request.Id); } var model = TrainerUserDetailModel.Create(trainerUser); return(new ResponseModel <TrainerUserDetailModel>(model)); }