Exemplo n.º 1
0
        public static CacheCreationResult <T> GetOrCreate <T>(this AbstractCacheProvider provider, CacheKey key, Func <T> callback)
        {
            var cachePolicy = provider.GetCachePolicyForKey(key);

            return(provider.GetOrCreate(key, () => new CacheValueOf <T>(callback.Invoke(), cachePolicy)));
        }
Exemplo n.º 2
0
 public static CacheCreationResult <T> GetOrCreate <T>(this AbstractCacheProvider provider, string key, Func <T> callback, ICachePolicy cachePolicy)
 {
     return(provider.GetOrCreate(key, () => new CacheValueOf <T>(callback.Invoke(), cachePolicy)));
 }