Example #1
0
 public static Assembly Get(MemoryCacheKey key)
 {
     Assembly ass;
     cacheLock.EnterReadLock();
     try
     {
         innerCache.TryGetValue(key.Key, out ass);
         return ass;
     }
     finally
     {
         cacheLock.ExitReadLock();
     }
 }
Example #2
0
            public static void Add(MemoryCacheKey key, Assembly serviceAssembly)
            {
                Assembly ass;

                cacheLock.EnterWriteLock();
                try
                {

                    if (key.Type == WsdlCache.None)
                    {
                        if (innerCache.TryGetValue(key.WsdlLocation, out ass))
                        {
                            // key which has also content hash is present without contentHash
                            // that means different type of caching was used for this wsdl
                            // => delete this key
                            innerCache.Remove(key.WsdlLocation);
                        }
                    }

                    innerCache.Add(key.Key, serviceAssembly);
                }
                finally
                {
                    cacheLock.ExitWriteLock();
                }
            }
Example #3
0
 public void Remove(MemoryCacheKey key)
 {
     this.Remove(key.ToString());
 }
Example #4
0
 public bool IsSet(MemoryCacheKey key)
 {
     return(IsSet(key, ""));
 }
Example #5
0
 public T Get <T>(MemoryCacheKey cacheKey, object addKey, Func <T> acquire)
 {
     return(Get(cacheKey, addKey, 60, acquire));
 }
Example #6
0
 public T Get <T>(MemoryCacheKey cacheKey, Func <T> acquire)
 {
     return(Get(cacheKey, "", 60, acquire));
 }