Files changed (8)
- Assert.AreEqual(0, TestCache.testdictionary.TrackedCount); //ensure keys are removed after we know they don't exist
- Assert.AreEqual(1, TestCache.testdictionary.TrackedCount); //ensure no duplicate keys for the same object
- /// A super fast concurrent "dictionary" which passes through to the generated Cache class which constructed it.
- if(realkey!=null) //ConcurrentDictionary's enumator represents a snapshot, so while iterating, the key may no longer exist
+ /// If value is null and the key exists, it is removed. If the key doesn't exist, it is added. If the key does exist, it is updated
+ /// This is ideal for using reference types as keys where the ToString value is not to be considered unique or suitable for caching
+ /// This WILL NOT scale to a distributed cache, because reference types are inheritely "unique" no matter if the content is the same.
+ public TrackingCacheDictionary(string basekey, CacheObject info, StoreToCache store, GetFromCache get)
+ if(realkey!=null) //ConcurrentDictionary's enumator represents a snapshot, so while iterating, the key may no longer exist