public void Add(object key, DateTime expired) { var kci = new KeyCacheItem(key, expired); kci.OnExpired += Kci_OnExpired; keyValuePairs.TryAdd(key, kci); }
public void Remove(KeyCacheItem obj) { keyValuePairs.TryRemove(obj.Key, out KeyCacheItem kci); }
private void Kci_OnExpired(KeyCacheItem obj) { Remove(obj); }