Example #1
0
        public void Add(ICacheKey cacheKey, object value, ICacheDependency dependency, DateTime expirationDate, TimeSpan slidingSpan, RuntimeCommon.Caching.CacheItemPriority priority)
        {
            var policy = new CacheItemPolicy();

            { //configurations
                var depKeys = TransformDependency(dependency)?.ToList();
                if (!depKeys.IsNullOrEmpty())
                {
                    foreach (var key in depKeys)
                    {
                        subscription.SubscribeTopic(key);
                    }

                    var monitor = new PubSubMonitor(cacheKey.GetKeyAsString(), depKeys, filter);

                    policy.ChangeMonitors.Add(monitor);
                }

                policy.SlidingExpiration = slidingSpan == CacheUtils.NoSliding ?
                                           ObjectCache.NoSlidingExpiration :
                                           slidingSpan;

                policy.AbsoluteExpiration = expirationDate == CacheUtils.NoExpiration ?
                                            ObjectCache.InfiniteAbsoluteExpiration :
                                            expirationDate;

                policy.Priority = priority == RuntimeCommon.Caching.CacheItemPriority.NotRemovable ?
                                  System.Runtime.Caching.CacheItemPriority.NotRemovable :
                                  System.Runtime.Caching.CacheItemPriority.Default;
            }
            memoryCacheInstance.Set(cacheKey.GetKeyAsString(), value, policy);
        }
Example #2
0
 public void AddObject(string objectId, object o, ICacheDependency dep)
 {
     lock (lockHelper)
     {
         cachedStrategy.AddObjectWithDepend(objectId, o, dep);
     }
 }
Example #3
0
        protected override bool Add(string regName, BasePlugInAttribute attribute, Type type)
        {
            Attribute instanceAttr = Attribute.GetCustomAttribute(type, typeof(InstancePlugInAttribute));

            if (instanceAttr != null)
            {
                BindingFlags flags     = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
                FieldInfo    fieldInfo = type.GetField("Instance", flags);
                if (fieldInfo == null)
                {
                    fieldInfo = type.GetField("INSTANCE", flags);
                    if (fieldInfo == null)
                    {
                        return(false);
                    }
                }
                object value = ObjectUtil.GetStaticValue(fieldInfo);
                if (value == null)
                {
                    return(false);
                }
                ICacheDependency dependency = CacheUtil.GetDependency(type, null);
                if (dependency == null)
                {
                    dependency = AlwaysDependency.Dependency;
                }

                return(AddInstance(regName, attribute, value, dependency) != null);
            }
            else
            {
                return(base.Add(regName, attribute, type));
            }
        }
Example #4
0
            public CacheTokenItem(string type, string[] tokens, ICacheDependency cacheDependency, string varyHeader)
            {
                TypeName = type;
                _tokens  = tokens;

                VaryHeader = varyHeader;
            }
Example #5
0
        public SqlCodeTable(MarcoConfigItem sql)
        {
            TkDebug.AssertArgumentNull(sql, "sql", null);

            Sql         = sql;
            fDependency = NoDependency.Dependency;
        }
Example #6
0
        public object GetItem(string key, BaseCacheItemCreator creator, params object[] args)
        {
            object result = null;

            ICacheDataConverter converter = GetDataConverter(creator);

            var distributeKey = GetDistributeKey(creator, key);

            if (GetCacheInstance(distributeKey, converter, out var cacheObject))
            {
                return(cacheObject);
            }
            try
            {
                result = creator.Create(key, args);
                TkDebug.AssertNotNull(result, string.Format(ObjectUtil.SysCulture,
                                                            "类型为{0}缓存对象创建者没有创建缓存对象,请确认",
                                                            creator.GetType()), creator);
            }
            catch (Exception ex)
            {
                TkDebug.ThrowToolkitException(string.Format(ObjectUtil.SysCulture,
                                                            "类型为{0}缓存对象创建者在创建对象时发生例外,请检查原因",
                                                            creator.GetType()), ex, creator);
            }
            ICacheDependency           dependency           = CacheUtil.SearchDependency(result);
            IDistributeCacheDependency distributeDependency = dependency as IDistributeCacheDependency;

            TkDebug.AssertNotNull(distributeDependency,
                                  $"附着的ICacheDependency(类型为{dependency.GetType()})不支持IDistributeCacheDependency", dependency);
            AddCacheInstance(distributeKey, result, converter, distributeDependency,
                             creator.Attribute.ForceCache);
            return(result);
        }
Example #7
0
        private static CacheItemPolicy BuildCachePolicy(
            DateTime?absoluteExpiration       = null,
            TimeSpan?slidingExpiration        = null,
            CacheEntryRemovedCallback removed = null,
            CacheEntryUpdateCallback updated  = null,
            ICacheDependency dependency       = null)
        {
            var policy = new CacheItemPolicy
            {
                Priority           = CacheItemPriority.Default,
                AbsoluteExpiration = absoluteExpiration.HasValue ? absoluteExpiration.Value : ObjectCache.InfiniteAbsoluteExpiration,
                SlidingExpiration  = slidingExpiration.HasValue ? slidingExpiration.Value : ObjectCache.NoSlidingExpiration,
                RemovedCallback    = removed,
                UpdateCallback     = updated
            };

            if (dependency != null)
            {
                var fileDependency = dependency as IFileCacheDependency;
                if (fileDependency != null)
                {
                    policy.ChangeMonitors.Add(new HostFileChangeMonitor(fileDependency.FilePaths));
                }
            }
            return(policy);
        }
Example #8
0
        /// <summary>
        /// 添加指定ID的cache 有依赖项
        /// </summary>
        /// <param name="objId"></param>
        /// <param name="o"></param>
        /// <param name="dep">ICacheDependency</param>
        public void AddObjectWithDepend(string objId, object o, ICacheDependency dep)
        {
            if (dep.DependType == EnumDependType.CacheDepend)
            {
                string depend_key   = CacheKey.DEPEND + objId;
                string depend_value = dep.Dependkey;

                string depctime_key   = CacheKey.DEPCTIME + objId;
                object depctime_value = GetCache(CacheKey.CTIME + dep.Dependkey);

                //判断dependkey是否存在
                if (depctime_value != null)
                {
                    AddObject(objId, o);

                    //Depend key
                    AddCache(depend_key, depend_value);
                    //DEPTIME
                    AddCache(depctime_key, depctime_value);
                }
                else
                {
                    AddObject(objId, o);
                }
            }
            else// 文件依赖
            {
                ///TODO:
            }
        }
Example #9
0
 public CacheManager(IServiceProvider provider)
 {
     _distributedCache = provider.GetRequiredService <IDistributedCache>();
     _cacheDependency  = provider.GetRequiredService <ICacheDependency>();
     _memoryCache      = provider.GetRequiredService <IMemoryCache>();
     _config           = provider.GetRequiredService <IConfiguration>();
     _logger           = provider.GetRequiredService <ILogger <CacheManager> >();
 }
Example #10
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="key">缓存项健值</param>
 /// <param name="value">储存项值</param>
 /// <param name="cacheDependency">过期策略</param>
 public CacheItem(string key, object @value, ICacheDependency cacheDependency)
 {
     this.Key = key;
     this.Value = @value;
     this.CacheDependency = cacheDependency;
     this.Hits = 0;
     this.LastAccessTime = DateTime.Now;
 }
Example #11
0
 public SimpleCacheManager(ICacheDependency cacheDependency,
                           IMemoryCache memoryCache,
                           ILogger <CacheManager> logger)
 {
     _cacheDependency = cacheDependency;
     _memoryCache     = memoryCache;
     _logger          = logger;
 }
Example #12
0
 /// <summary>
 /// Initializes a new instance of the InstanceRegItem class.
 /// </summary>
 public InstanceRegItem(string regName, BasePlugInAttribute attribute,
                        object instance, ICacheDependency dependency)
     : base(regName, attribute)
 {
     fInstance     = instance;
     fInstanceType = instance.GetType();
     Dependency    = dependency;
 }
Example #13
0
 public CacheItem(object value, ICacheDependency expires) : this(value)
 {
     if (expires == null)
     {
         throw new ArgumentNullException(nameof(expires));
     }
     this.Dependencies.Add(expires);
 }
 public bool Set <T>(string key, T value, TimeSpan slidingExpiration, ICacheDependency dependency)
 {
     return(Try(() =>
     {
         var entry = CreateEntry(slidingExpiration: slidingExpiration);
         SetWithType(key, value, entry);
     }));
 }
Example #15
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="key">缓存项健值</param>
 /// <param name="value">储存项值</param>
 /// <param name="cacheDependency">过期策略</param>
 public CacheItem(string key, object @value, ICacheDependency cacheDependency)
 {
     this.Key             = key;
     this.Value           = @value;
     this.CacheDependency = cacheDependency;
     this.Hits            = 0;
     this.LastAccessTime  = DateTime.Now;
 }
Example #16
0
 /// <summary>
 /// Initializes a new instance of the XsltTransformCacheData class.
 /// </summary>
 /// <param name="fileNames"></param>
 public XsltTransformCacheData(XslCompiledTransform transform, string[] fileNames)
 {
     fFileNames = fileNames;
     Transform  = transform;
     //fAttribute = fileNames == null ? AlwaysCacheAttribute.Attribute :
     //    new FilesCacheAttribute(fFileNames, FilePathPosition.AbsolutePath);
     fDependency = AlwaysDependency.Dependency;
 }
 public bool Set <T>(string key, T value, DateTimeOffset absoluteExpiration, ICacheDependency dependency)
 {
     return(Try(() =>
     {
         var entry = CreateEntry(absoluteExpiration);
         SetWithType(key, value, entry);
     }));
 }
 public bool Set <T>(string key, T value, ICacheDependency dependency)
 {
     return(Try(() =>
     {
         var entry = CreateEntry();
         SetWithType(key, value, entry);
     }));
 }
Example #19
0
        public static DateTimeOffset?GetAbsoluteExpiration(this ICacheDependency dependency)
        {
            if (dependency is ICacheDependencyTime dependencyTime)
            {
                return(new DateTimeOffset(dependencyTime.AbsoluteExpiration));
            }

            return(null);
        }
Example #20
0
 public bool Add <T>(string key, T value, TimeSpan slidingExpiration, ICacheDependency dependency)
 {
     if (Cache.Get(key) != null)
     {
         return(false);
     }
     Cache.Set(key, value, CreateEntry(slidingExpiration: slidingExpiration));
     return(true);
 }
Example #21
0
 public bool Add <T>(string key, T value, DateTimeOffset absoluteExpiration, ICacheDependency dependency)
 {
     if (Cache.Get(key) != null)
     {
         return(false);
     }
     Cache.Set(key, value, CreateEntry(absoluteExpiration, dependency: dependency));
     return(true);
 }
Example #22
0
 public bool Add <T>(string key, T value, ICacheDependency dependency)
 {
     if (Cache.Get(key) != null)
     {
         return(false);
     }
     Cache.Set(key, value, CreateEntry(dependency: dependency));
     return(true);
 }
Example #23
0
            public void AddCacheDependency(ICacheDependency cacheDependency)
            {
                if (_dependencies == null)
                {
                    _dependencies = new List <ICacheDependency>();
                }

                _dependencies.Add(cacheDependency);
            }
Example #24
0
 public bool Add(string key, object value, ICacheDependency dependency)
 {
     if (_cache.Get(key) != null)
     {
         return(false);
     }
     _cache.Set(key, value, CreateEntry(dependency: dependency));
     return(true);
 }
Example #25
0
        /// <summary>
        /// Converts abstraction to implementation
        /// </summary>
        /// <param name="dependency"></param>
        /// <returns></returns>
        protected virtual CacheDependency ConvertDependency(ICacheDependency dependency)
        {
            if (dependency == null)
            {
                return(null);
            }

            return(new CacheDependency(dependency.FileNames?.ToArray(), dependency.CacheKeys?.ToArray(), dependency.SubCacheDependency != null ? ConvertDependency(dependency.SubCacheDependency) : null));
        }
Example #26
0
 public bool Add(string key, object value, DateTime absoluteExpiration, ICacheDependency dependency)
 {
     if (_cache.Get(key) != null)
     {
         return(false);
     }
     _cache.Set(key, value, CreateEntry(absoluteExpiration, dependency: dependency));
     return(true);
 }
Example #27
0
 /****************************************************************************/
 public override void Add(string key, object objToAdd, DateTime expires, ICacheDependency dependency = null)
 {
     try
     {
         System.Web.Hosting.HostingEnvironment.Cache.Insert(key, objToAdd, ToCacheDependency(dependency), expires, System.Web.Caching.Cache.NoSlidingExpiration);
     }
     catch
     {
     }
 }
Example #28
0
 /****************************************************************************/
 public override void Add(string key, object objToAdd, TimeSpan expires, ICacheDependency dependency = null)
 {
     try
     {
         System.Web.Hosting.HostingEnvironment.Cache.Insert(key, objToAdd, ToCacheDependency(dependency), System.Web.Caching.Cache.NoAbsoluteExpiration, expires);
     }
     catch
     {
     }
 }
        public bool Add <T>(string key, T value, ICacheDependency dependency)
        {
            if (_cache.Get(key) != null)
            {
                return(false);
            }
            var entry = CreateEntry();

            SetWithType(key, value, entry);
            return(true);
        }
        public bool Add <T>(string key, T value, TimeSpan slidingExpiration, ICacheDependency dependency)
        {
            if (_cache.Get(key) != null)
            {
                return(false);
            }
            var entry = CreateEntry(slidingExpiration: slidingExpiration);

            SetWithType(key, value, entry);
            return(true);
        }
        public bool Add <T>(string key, T value, DateTimeOffset absoluteExpiration, ICacheDependency dependency)
        {
            if (_cache.Get(key) != null)
            {
                return(false);
            }
            var entry = CreateEntry(absoluteExpiration);

            SetWithType(key, value, entry);
            return(true);
        }
        public IList<Blog> GetAll()
        {
            var sqlCacheDependency = cacheProvider.CreateCacheDependency<ISqlCacheDependency>()
                .Initialise("BloggingContext", "Blogs");

            ICacheDependency[] cacheDependencies = new ICacheDependency[] { sqlCacheDependency };

            string key = string.Format("CacheDiSample.DataAccess.GetAll");

            return cacheProvider.Fetch(key, () =>
            {
                return parentBlogRepository.GetAll();
            },
                null, null, cacheDependencies)
            .ToList();
        }
        public CacheDetails(
            TimeSpan absoluteCacheExpiration,
            TimeSpan slidingCacheExpiration,
            ICacheDependency cacheDependency
            )
        {
            if (absoluteCacheExpiration == null)
                throw new ArgumentNullException("absoluteCacheExpiration");
            if (slidingCacheExpiration == null)
                throw new ArgumentNullException("slidingCacheExpiration");
            if (cacheDependency == null)
                throw new ArgumentNullException("cacheDependency");

            this.absoluteCacheExpiration = absoluteCacheExpiration;
            this.slidingCacheExpiration = slidingCacheExpiration;
            this.cacheDependency = cacheDependency;
        }
 public SiteMapLoaderContainer(ConfigurationSettings settings)
 {
     // Singleton instances
     if (settings.EnableSiteMapFile)
     {
         this.absoluteFileName = HostingEnvironment.MapPath(settings.SiteMapFileName);
     }
     this.mvcContextFactory = new MvcContextFactory();
     #if NET35
     this.siteMapCache = new SiteMapCache(new AspNetCacheProvider<ISiteMap>(this.mvcContextFactory));
     #else
     this.siteMapCache = new SiteMapCache(new RuntimeCacheProvider<ISiteMap>(System.Runtime.Caching.MemoryCache.Default));
     #endif
     this.cacheDependency = this.ResolveCacheDependency(settings);
     this.requestCache = this.mvcContextFactory.GetRequestCache();
     this.bindingFactory = new BindingFactory();
     this.bindingProvider = new BindingProvider(this.bindingFactory, this.mvcContextFactory);
     this.urlPath = new UrlPath(this.mvcContextFactory, this.bindingProvider);
     this.siteMapCacheKeyGenerator = new SiteMapCacheKeyGenerator(this.mvcContextFactory);
     this.siteMapCacheKeyToBuilderSetMapper = new SiteMapCacheKeyToBuilderSetMapper();
     this.reservedAttributeNameProvider = new ReservedAttributeNameProvider(settings.AttributesToIgnore);
     var siteMapNodeFactoryContainer = new SiteMapNodeFactoryContainer(settings, this.mvcContextFactory, this.urlPath, this.reservedAttributeNameProvider);
     this.siteMapNodeToParentRelationFactory = new SiteMapNodeToParentRelationFactory();
     this.nodeKeyGenerator = new NodeKeyGenerator();
     this.siteMapNodeFactory = siteMapNodeFactoryContainer.ResolveSiteMapNodeFactory();
     this.siteMapNodeCreatorFactory = this.ResolveSiteMapNodeCreatorFactory();
     this.cultureContextFactory = new CultureContextFactory();
     this.dynamicSiteMapNodeBuilderFactory = new DynamicSiteMapNodeBuilderFactory(this.siteMapNodeCreatorFactory, this.cultureContextFactory);
     this.siteMapHierarchyBuilder = new SiteMapHierarchyBuilder();
     this.siteMapNodeHelperFactory = this.ResolveSiteMapNodeHelperFactory();
     this.siteMapNodeVisitor = this.ResolveSiteMapNodeVisitor(settings);
     this.siteMapXmlNameProvider = new SiteMapXmlNameProvider();
     this.attributeAssemblyProviderFactory = new AttributeAssemblyProviderFactory();
     this.mvcSiteMapNodeAttributeDefinitionProvider = new MvcSiteMapNodeAttributeDefinitionProvider();
     this.siteMapNodeProvider = this.ResolveSiteMapNodeProvider(settings);
     this.siteMapBuiderSetStrategy = this.ResolveSiteMapBuilderSetStrategy(settings);
     var siteMapFactoryContainer = new SiteMapFactoryContainer(settings, this.mvcContextFactory, this.urlPath);
     this.siteMapFactory = siteMapFactoryContainer.ResolveSiteMapFactory();
     this.siteMapCreator = new SiteMapCreator(this.siteMapCacheKeyToBuilderSetMapper, this.siteMapBuiderSetStrategy, this.siteMapFactory);
 }
 public CacheDetails(TimeSpan absoluteCacheExpiration, TimeSpan slidingCacheExpiration, ICacheDependency cacheDependency)
 {
     this.absoluteCacheExpiration = absoluteCacheExpiration;
     this.slidingCacheExpiration = slidingCacheExpiration;
     this.cacheDependency = cacheDependency;
 }
Example #36
0
 public void Add(object key, object value, DateTime absoluteExpiration, ICacheDependency dependency, ObjectCacheItemRemovedCallback callback)
 {
     if (key == null)
     {
         throw new ArgumentNullException("key");
     }
     CacheItem item = this.Wrap(key, value);
     if (absoluteExpiration != DateTime.MaxValue)
     {
         item.AbsoluteExpiration = absoluteExpiration.AddSeconds(-1.0);
     }
     if (dependency != null)
     {
         item.Dependency = dependency;
     }
     if (callback != null)
     {
         item.Callback = callback;
     }
     this.Add(item);
 }
Example #37
0
 /// <summary>
 /// ���һ���������
 /// </summary>
 /// <param name="key">������Ľ�ֵ</param>
 /// <param name="value">����Ķ���</param>
 /// <param name="cacheDependency">������Ĺ��ڲ���</param>
 public void Add(string key, object value, ICacheDependency cacheDependency)
 {
     this.IsInit();
     CacheItem item = (CacheItem)this.cacheStorage[key];
     if(item == null) {
         item = new CacheItem(key, value, cacheDependency);
     } else {
         item.Value = value;
     }
     this.cacheStorage[key] = item;
 }
Example #38
0
 /// <summary>
 /// 创建存储项实体
 /// </summary>
 /// <param name="key">健值</param>
 /// <param name="value">实际缓存的对象</param>
 /// <param name="cacheDependency">过期依赖</param>
 /// <returns>存储项实体</returns>
 ICacheItem ICacheStorage.CreateCacheItem(string key, object value, ICacheDependency cacheDependency)
 {
     return this.CacheStorage.CreateCacheItem(key, value, cacheDependency);
 }
 public void AddObjectWithDepend(string objId, object o, ICacheDependency dep)
 {
     if (dep.DependType == EnumDependType.FileDepend)
     {
         AddObjectWithFileChange(objId, o, dep.Dependkey);
     }
     else
     {
         AddObjectWithDepend(objId, o, new string []{dep.Dependkey});
     }
 }
Example #40
0
 /// <summary>
 /// ��ָ����ֵ�͹��ڲ��������û����ֵ��
 /// </summary>
 /// <param name="key">������Ľ�ֵ</param>
 /// <param name="cacheDependency">������Ĺ��ڲ���</param>
 public object this[string key, ICacheDependency cacheDependency]
 {
     set { this.Add(key, value, cacheDependency); }
 }
Example #41
0
 public bool Set(string key, byte[] value, ICacheDependency dependency)
 {
     return _inner.Set(key, PrepareData(value), dependency);
 }
Example #42
0
 internal CacheItem(object key, object value, CacheKeyDependency dependency)
 {
     if (key == null)
     {
         throw new ArgumentNullException("key");
     }
     this._key = key;
     this._value = value;
     this._removedReason = ObjectCacheItemRemovedReason.Underused;
     this._dateCreated = DateTime.UtcNow;
     this._absoluteExpiration = this._dateCreated.AddSeconds(300.0);
     this._dependency = dependency;
     this._callback = null;
 }
Example #43
0
    /// <summary>
    /// 创建 CacheToken
    /// </summary>
    /// <param name="cacheDependency">缓存依赖项</param>
    /// <param name="varyHeader">客户端缓存依赖头</param>
    /// <param name="typeName">缓存标记类别名称</param>
    /// <param name="tokens">用于标识的字符串</param>
    /// <returns>创建的 CacheToken</returns>
    public static CacheToken CreateToken( string typeName, ICacheDependency cacheDependency, string varyHeader, string[] tokens )
    {
      if ( typeName == null )
        throw new ArgumentNullException( "typeName" );

      if ( tokens == null )
        throw new ArgumentNullException( "tokens" );

      return new CacheTokenItem( typeName, tokens, cacheDependency, varyHeader );
    }
Example #44
0
 public bool Add(string key, string value, ICacheDependency dependency)
 {
     return _inner.Add(key, PrepareData(value), dependency);
 }
Example #45
0
 public bool Add(string key, string value, DateTime absoluteExpiration, ICacheDependency dependency)
 {
     return _inner.Add(key, PrepareData(value), absoluteExpiration, dependency);
 }
Example #46
0
 public bool Add(string key, string value, TimeSpan slidingExpiration, ICacheDependency dependency)
 {
     return _inner.Add(key, PrepareData(value), slidingExpiration, dependency);
 }
Example #47
0
 public void Add(object key, object value, DateTime absoluteExpiration, ICacheDependency dependency)
 {
     this.Add(key, value, absoluteExpiration, dependency, null);
 }
Example #48
0
 public bool Set(string key, byte[] value, DateTime absoluteExpiration, ICacheDependency dependency)
 {
     return _inner.Set(key, PrepareData(value), absoluteExpiration, dependency);
 }
Example #49
0
        /// <summary>
        /// 添加指定ID的cache 有依赖项
        /// </summary>
        /// <param name="objId"></param>
        /// <param name="o"></param>
        /// <param name="dep">ICacheDependency</param>
        public void AddObjectWithDepend(string objId, object o, ICacheDependency dep)
        {
            if (dep.DependType == EnumDependType.CacheDepend)
            {
                string depend_key = CacheKey.DEPEND + objId;
                string depend_value = dep.Dependkey;

                string depctime_key = CacheKey.DEPCTIME + objId;
                object depctime_value = GetCache(CacheKey.CTIME + dep.Dependkey);

                //判断dependkey是否存在
                if (depctime_value != null)
                {
                    AddObject(objId, o);

                    //Depend key
                    AddCache(depend_key, depend_value);
                    //DEPTIME
                    AddCache(depctime_key, depctime_value);
                }
                else
                {
                    AddObject(objId, o);
                }
            }
            else// 文件依赖
            {
               ///TODO:
            }
        }
Example #50
0
 public bool Set(string key, byte[] value, TimeSpan slidingExpiration, ICacheDependency dependency)
 {
     return _inner.Set(key, PrepareData(value), slidingExpiration, dependency);
 }
 public void AddObject(string objectId, object o, ICacheDependency dep)
 {
     lock (lockHelper)
     {
         cachedStrategy.AddObjectWithDepend(objectId, o, dep);
     }
 }
Example #52
0
            public void AddCacheDependency(ICacheDependency cacheDependency)
            {
                if (_dependencies == null)
                {
                    _dependencies = new List<ICacheDependency>();
                }

                _dependencies.Add(cacheDependency);
            }
Example #53
0
      public CacheTokenItem( string type, string[] tokens, ICacheDependency cacheDependency, string varyHeader )
      {
        TypeName = type;
        _tokens = tokens;

        VaryHeader = varyHeader;

      }