关于nop3.3 redis缓存

时间:2014-08-04 09:15:39

标签: redis nopcommerce

我在

下写了一个缓存扩展代码
public class RedisManager:ICacheManager
    {
        private readonly RedisClient _client;
        public RedisManager()
        {
            _client = new RedisClient("127.0.0.1", 6379);
        }
        public T Get<T>(string key)
        {
            return _client.Get<T>(key);
        }

        public void Set(string key, object data, int cacheTime)
        {
            _client.Add(key, data);
        }

        public bool IsSet(string key)
        {
            return _client.ContainsKey(key);
        }

        public void Remove(string key)
        {
            _client.Remove(key);
        }

        public void RemoveByPattern(string pattern)
        {
            _client.RemoveByPattern(pattern);
        }

        public void Clear()
        {
            _client.FlushDb();
        }
    }

然后修改配置

builder.RegisterType<RedisManager>().As<ICacheManager>().Named<ICacheManager>("nop_redis_cache_static").SingleInstance();

但在运行错误后,错误是:

  

未处理的异常“System.StackOverflowException”类型的位置   System.Web.dll中

我们如何解决?

0 个答案:

没有答案