MemoryCacheTGetOrAdd(String, FuncT, CacheEntryRemovedCallback) Method
Gets or adds a value, based on result of valueFactory, to the memory cache. Cache defaults to a 1-minute expiration.
Namespace: Gemstone.CachingAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.169 -- Release Build+7345f63a8c9771f20dc280b192df2ccb62049660
Gemstone.Caching.MemoryCache.GetOrAdd = function(cacheName, valueFactory, removedCallBack);
- cacheName String
- Name to use as cache key -- this should be unique per T.
- valueFactory FuncT
- Function to generate value to add to cache -- only called if value is not already cached.
- removedCallBack CacheEntryRemovedCallback (Optional)
- Optional function to call when cache entry is removed.
T
Value from cache if already cached; otherwise, new value generated by
valueFactory.