Esempio n. 1
0
        public void AddTypeToCache(Type type, IList <ILookup> lookups, DateTime expiration)
        {
            lock (LockObj)
            {
                var cachedType = GetByType(type);

                if (cachedType == null)
                {
                    cachedType = new LookupCacheItem
                    {
                        LookupType = type
                    };

                    _cache.Add(cachedType);
                }

                cachedType.LookupCache = lookups;
                cachedType.Expiration  = expiration;
            }
        }
Esempio n. 2
0
        public void AddTypeToCache(Type type, IList<ILookup> lookups, DateTime expiration)
        {
            lock (LockObj)
            {
                var cachedType = GetByType(type);

                if (cachedType == null)
                {
                    cachedType = new LookupCacheItem
                    {
                        LookupType = type
                    };

                    _cache.Add(cachedType);
                }

                cachedType.LookupCache = lookups;
                cachedType.Expiration = expiration;
            }
        }