public static Assembly Get(MemoryCacheKey key) { Assembly ass; cacheLock.EnterReadLock(); try { innerCache.TryGetValue(key.Key, out ass); return ass; } finally { cacheLock.ExitReadLock(); } }
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(); } }
public void Remove(MemoryCacheKey key) { this.Remove(key.ToString()); }
public bool IsSet(MemoryCacheKey key) { return(IsSet(key, "")); }
public T Get <T>(MemoryCacheKey cacheKey, object addKey, Func <T> acquire) { return(Get(cacheKey, addKey, 60, acquire)); }
public T Get <T>(MemoryCacheKey cacheKey, Func <T> acquire) { return(Get(cacheKey, "", 60, acquire)); }