public virtual LookupItemCollection GetLookups(string collectionName) { cacheLock.EnterUpgradeableReadLock(); try { Dictionary <string, LookupItemCollection> cachedItems = new Dictionary <string, LookupItemCollection>(); if (CacheProvider.Contains(this.Name)) { cachedItems = CacheProvider.Read(this.Name) as Dictionary <string, LookupItemCollection>; } if (cachedItems.ContainsKey(collectionName)) { return(cachedItems[collectionName]); } else { cacheLock.EnterWriteLock(); try { LookupItemCollection result = InitializeLookups(collectionName); cachedItems.Add(collectionName, result); CacheProvider.Update(this.Name, cachedItems); return(result); } finally { cacheLock.ExitWriteLock(); } } } finally { cacheLock.ExitUpgradeableReadLock(); } }
public abstract void SaveLookups(LookupItemCollection lookups);