我收到错误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();
}
}
它是否已折旧?
答案 0 :(得分:2)
API to get a Typed Redis client为As<T>
,例如:
using(var typedClient = _redisClient.As<Customer>())
{
return typedClient.GetAll();
}
答案 1 :(得分:0)
该方法现在位于IRedisTypedClient中。可以在此处找到文档:https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisTypedClient