private List <T> GetCachedItems <TU>(IEnumerable <TU> keys) { var results = new List <T>(); foreach (var key in keys) { if (primaryCache.Contains(key)) { results.Add(CacheLock.Read(Lock, () => primaryCache.GetByKey(key))); } else { results.AddRange(CacheLock.Read(Lock, () => secondaryCaches.Get(key))); } } return(results); }