private static void CleanUpCache() { var limit = DateTime.Now - TimeSpan.FromMinutes(10); var toRemoval = LocalCache.Where(x => x.Value.Item1 < limit).Select(x => x.Key).ToList(); foreach (var key in toRemoval) { LocalCache.Remove(key); } }