private CacheInitializer <T> GetInitializer()
        {
            var initializer = new CacheInitializer <T>(_key, _initializer);

            if (_interceptor != null)
            {
                initializer.SetInterceptor(_interceptor);
            }

            return(initializer);
        }
Example #2
0
        public CacheVariable(ICache cache, string key, CacheInitializer <T> initializer, IEnumerable <CacheExpirationInfo> expirationConfigs, int timeout, bool lazyLoad)
        {
            _cache = cache;
            _log   = LogManager.GetLogger(GetType());

            Key                   = key;
            Initializer           = initializer;
            InitializationTimeout = timeout;
            LazyLoad              = lazyLoad;
            _expirationConfigs    = expirationConfigs;

            if (!lazyLoad)
            {
                GetOrLoadValue();
            }
        }