Exemplo n.º 1
0
        public CacheInterceptor(ICacheProvider[] cacheProviders, ICacheKeyGenerator cacheKeyGenerator, 
            IConfigValueProvider configValueProvider, IServiceLocator serviceLocator, ISerializer serializer)
        {
            this.cacheProviders = cacheProviders;
            this.cacheKeyGenerator = cacheKeyGenerator;
            this.serviceLocator = serviceLocator;
            this.serializer = serializer;

            cacheExpiryMinutes = Convert.ToInt32(configValueProvider.GetValue("CacheInterceptor.SlidingExpiration"));

            //The first cache provider is the default.
            defaultCacheProvider = cacheProviders.First();

            // Default to 5 minutes sliding expiration
            if (cacheExpiryMinutes == 0)
                cacheExpiryMinutes = 5;

            cacheEnabled = Convert.ToBoolean(configValueProvider.GetValue("CacheInterceptor.Enabled"));
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="cache"></param>
 public CacheHandler(params ICacheProvider[] cache)
 {
     this.cache = cache;
 }