public static List <GoodsModel> GetListAll(int playerId, int belongsTo, out bool fromCache) { fromCache = false; string redisKey = RedisKeyHelper.GetRedisKeyName(RedisKeyConfig.Goods, playerId.ToString(), belongsTo.ToString()); var list = redisCacheHelper.StringGet <List <GoodsModel> >(redisKey); if (list != null) { fromCache = true; return(list); } else { list = GoodsDAL.GetListAll(playerId, belongsTo); redisCacheHelper.StringSet(redisKey, list, CommonConfig.DefRedisExpiry); return(list); } }