找不到IRedisClient GetTypedClient

时间:2016-10-28 23:49:29

标签: servicestack.redis

我收到错误IRedisClient不包含GetTypedClient的定义:

   private readonly IRedisClient _redisClient; 

    public CustomerRepository(IRedisClient redisClient)
    {
        _redisClient = redisClient;
    }

    public IList<Order> GetAll()
    {
        using(var typedClient = _redisClient.GetTypedClient<Customer>())
        {
            return typedClient.GetAll();
        }
    }

它是否已折旧?

2 个答案:

答案 0 :(得分:2)

API to get a Typed Redis clientAs<T>,例如:

using(var typedClient = _redisClient.As<Customer>())
{
    return typedClient.GetAll();
}

答案 1 :(得分:0)

该方法现在位于IRedisTypedClient中。可以在此处找到文档:https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisTypedClient