예제 #1
0
 /// <summary>
 /// 按条件移除缓存
 /// </summary>
 /// <param name="keyStartsWith">键起始名</param>
 public void ClearStartsWith(string keyStartsWith) => CacheContext.ClearStartsWith(keyStartsWith);
예제 #2
0
 /// <summary>
 /// 批量移除缓存
 /// </summary>
 /// <param name="keysStartsWith">键起始名集合</param>
 public void ClearStartsWith(List <string> keysStartsWith) => CacheContext.ClearStartsWith(keysStartsWith);
예제 #3
0
 /// <summary>
 /// 清理所有缓存
 /// </summary>
 public void Clear() => CacheContext.Clear();
예제 #4
0
 /// <summary>
 /// 移除缓存
 /// </summary>
 /// <param name="key">缓存键</param>
 public void Remove(string key) => CacheContext.Invalidate(key);
예제 #5
0
 /// <summary>
 /// 检查缓存是否存在
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public bool IsSet(string key) => CacheContext.IsSet(key);
예제 #6
0
 /// <summary>
 /// 根据缓存键获取缓存
 /// </summary>
 /// <param name="key">The key.</param>
 public T GetCache <T>(string key) => CacheContext.Get <T>(key);
예제 #7
0
 /// <summary>
 /// 创建缓存
 /// </summary>
 /// <param name="key">缓存键</param>
 /// <param name="val">缓存值</param>
 /// <param name="expire">缓存时间</param>
 /// <returns></returns>
 public void Set(string key, object val, CacheTimes expire) => CacheContext.Set(key, val, expire);