private static void FillDictionary(int itemsInCache) { CustomCacheKey key; Console.WriteLine("Filling up the dictionary..."); for (int i = 0; i < itemsInCache; i++) { key = new CustomCacheKey(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "en-us", "web"); _dict.TryAdd(key, false); if (i % 100000 == 0) { Console.WriteLine("Items added: " + i); } } Console.WriteLine("Dictionary filled"); }
public bool Equals(CustomCacheKey cacheKey) { if (object.ReferenceEquals((object)null, (object)cacheKey)) { return(false); } if (object.ReferenceEquals((object)this, (object)cacheKey)) { return(true); } if (string.Equals(cacheKey.Object2Id, this.Object2Id, StringComparison.OrdinalIgnoreCase) && string.Equals(cacheKey.Object1Id, this.Object1Id, StringComparison.OrdinalIgnoreCase) && string.Equals(cacheKey.Langauge, this.Langauge, StringComparison.OrdinalIgnoreCase)) { return(string.Equals(cacheKey.Database, this.Database, StringComparison.OrdinalIgnoreCase)); } return(false); }