public T GetValByKey <T>(string key, Enums.MCaching.CacheGroup cacheGroup) { var result = default(T); try { var cacheKey = FormatKey(key, cacheGroup); result = _cacheClient.Get <T>(cacheKey); } catch (Exception ex) { MLogManager.Error(MLogGroup.Other.Memcached缓存, null, "获取缓存值 出错!", ex); } return(result); }
public bool Add <T>(string key, Enums.MCaching.CacheGroup cacheGroup, T obj) { var result = false; try { var cacheKey = FormatKey(key, cacheGroup); result = _cacheClient.Store(StoreMode.Add, cacheKey, obj); } catch (Exception ex) { MLogManager.Error(MLogGroup.Other.Memcached缓存, null, "添加缓存 出错!", ex); } return(result); }
public Dictionary <string, T> GetValByKeys <T>(List <string> keys, Enums.MCaching.CacheGroup cacheGroup) { var result = new Dictionary <string, T>(); if (keys != null && keys.Count > 0) { foreach (var key in keys) { try { result.Add(key, GetValByKey <T>(key, cacheGroup)); } catch (Exception ex) { MLogManager.Error(MLogGroup.Other.Redis缓存, null, "获取缓存值 出错!", ex); } } } return(result); }
public int RemoveByKeyGroup(Enums.MCaching.CacheGroup cacheGroup) { return(0); }
public bool RemoveByKey(string key, Enums.MCaching.CacheGroup cacheGroup) { return(false); }
public List <string> GetKeys(Enums.MCaching.CacheGroup cacheGroup) { return(null); }
public Dictionary <string, T> GetValByKeys <T>(List <string> keys, Enums.MCaching.CacheGroup cacheGroup) { return(null); }
public T GetValByKey <T>(string key, Enums.MCaching.CacheGroup cacheGroup) { return(default(T)); }
public bool Add <T>(string key, Enums.MCaching.CacheGroup cacheGroup, T obj) { return(false); }
public bool Add <T>(string key, Enums.MCaching.CacheGroup cacheGroup, T obj, DateTime expired) { return(false); }
public bool Contains(string key, Enums.MCaching.CacheGroup cacheGroup) { return(false); }
public bool Contains(string key, Enums.MCaching.CacheGroup cacheGroup) { MLogManager.Error(MLogGroup.Other.Memcached缓存, null, "没有方法实现"); throw new Exception("没有方法实现"); }
public int RemoveByKeyGroup(Enums.MCaching.CacheGroup cacheGroup) { MLogManager.Error(MLogGroup.Other.Memcached缓存, null, "没有方法实现"); throw new Exception("没有方法实现"); }
public bool RemoveByKey(string key, Enums.MCaching.CacheGroup cacheGroup) { MLogManager.Error(MLogGroup.Other.Memcached缓存, null, "没有方法实现"); return(RemoveByKey(FormatKey(key, cacheGroup))); }
public List <string> GetKeys(Enums.MCaching.CacheGroup cacheGroup) { MLogManager.Error(MLogGroup.Other.Memcached缓存, null, "没有方法实现"); throw new Exception("没有方法实现"); }