/// <summary> /// 构造函数。 /// </summary> /// <param name="cacheProvider"> /// 本缓存模块需要指定提供器。 /// </param> public Cache(CacheProvider cacheProvider) { if (cacheProvider == null) { throw new ArgumentNullException("cacheProvider"); } this._cacheProvider = cacheProvider; this.IsEnabled = true; }
/// <summary> /// 使用指定的硬盘缓存来构造二级缓存。 /// </summary> /// <param name="diskProvider"></param> public HybirdCacheProvider(CacheProvider diskProvider) { this._memory = new MemoryCacheProvider(); this._disk = diskProvider; }