/// <summary> /// 获取缓存 /// </summary> public static T Get <T>(string cacheType, string key) where T : class, new() { if (string.Compare(cacheType, CacheType.Web, true) == 0) { return(BaseCache.Get <T>(key)); } else if (string.Compare(cacheType, CacheType.Redis, true) == 0) { return(IRedis.GetAsy <T>(key).Result); } return(new T()); }
/// <summary> /// 获取缓存 /// </summary> public static T Get <T>(string cacheType, string key) where T : class, new() { if (cacheType.ToLower() == CacheType.Web) { return(BaseCache.Get <T>(key)); } else if (cacheType.ToLower() == CacheType.Redis) { return(IRedis.GetAsy <T>(key).Result); } return(new T()); }
/// <summary> /// 获取缓存 /// </summary> public static string Get(string cacheType, string key) { if (string.Compare(cacheType, CacheType.Web, true) == 0) { return(BaseCache.Get(key)); } else if (string.Compare(cacheType, CacheType.Redis, true) == 0) { return(IRedis.GetAsy(key).Result); } return(""); }
/// <summary> /// 获取缓存 /// </summary> public static string Get(string cacheType, string key) { if (cacheType.ToLower() == CacheType.Web) { return(BaseCache.Get(key)); } else if (cacheType.ToLower() == CacheType.Redis) { return(IRedis.GetAsy(key).Result); } return(""); }