'How to add more info in the results from a query on cosmos db using a dictionary?

I have some data stored in Comsos db and some other in SQL. The data from SQL is retrieved every 5 minutes and is stored in a ConcurrentDictionary. I need to query the data on Cosmos and add more info to the results using the dictionary. So here is the code:

public IAsyncEnumerable<LogDto> GetLogsAsync(string tenantId, CancellationToken cancellationToken)
        {
            return _container.GetItemLinqQueryable<Log>()
                .Where(l => l.TenantId != null && l.TenantId.ToLower() == tenantId.ToLower()) 
                .Take(10)
                .Select(l => new LogDto()
                {
                    SerialId = l.SerialId,
                    SiteId = l.SiteId,
                    SiteName = _cacheService._siteDictionary[l.SiteId],
                })
                .ToFeedIterator()
                .ToAsyncEnumerable(cancellationToken);
        }

But I get the following error:

The specified query includes 'member indexer' which is currently not supported.

Is there any workaround for this? Any help is greatly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source