示例#1
0
 /// <summary>
 /// 获取缓存的所有主键
 /// </summary>
 /// <returns></returns>
 public List <string> GetAllKeys()
 {
     return(RedisCache.GetAllKeys());
 }
示例#2
0
 /// <summary>
 /// 移除全部缓存
 /// </summary>
 public void RemoveCache()
 {
     RedisCache.RemoveAll();
 }
示例#3
0
 /// <summary>
 /// 移除指定数据缓存
 /// </summary>
 /// <param name="cacheKey">键</param>
 public void RemoveCache(string cacheKey)
 {
     RedisCache.Remove(cacheKey);
 }
示例#4
0
 /// <summary>
 /// 写入缓存
 /// </summary>
 /// <param name="value">对象数据</param>
 /// <param name="cacheKey">键</param>
 /// <param name="expireTime">到期时间</param>
 public void WriteCache <T>(T value, string cacheKey, DateTime expireTime) where T : class
 {
     RedisCache.Set(cacheKey, value, expireTime);
 }
示例#5
0
 /// <summary>
 /// 写入缓存
 /// </summary>
 /// <param name="value">对象数据</param>
 /// <param name="cacheKey">键</param>
 public void WriteCache <T>(T value, string cacheKey) where T : class
 {
     RedisCache.Set(cacheKey, value);
 }
示例#6
0
 /// <summary>
 /// 读取缓存
 /// </summary>
 /// <param name="cacheKey">键</param>
 /// <returns></returns>
 public T GetCache <T>(string cacheKey) where T : class
 {
     return(RedisCache.Get <T>(cacheKey));
 }