public virtual ICacheStorage CreateStorage(WebPageContext context) { var value = context.GetConfigValue <string>("Page", "CacheStorage", string.Empty).ToLower(); if (!string.IsNullOrEmpty(value)) { return(CacheStorageFactory.Create(value)); //通过存储器名称获取 } //通过后缀名获取 ICacheStorage storage = null; if (_storages.TryGetValue(context.PathExtension, out storage)) { return(storage); } return(StorageEmpty.Instance); }
public static IList <ICacheStorage> CreateStorages() { return(CacheStorageFactory.Creates()); }
public static ICacheStorage CreateStorage(string name) { return(CacheStorageFactory.Create(name)); }
/// <summary> /// 注册存储器名称 /// </summary> /// <param name="name"></param> /// <param name="storage"></param> public static void RegisterStorageName(string name, ICacheStorage storage) { CacheStorageFactory.Register(name, storage); }