.net core 3.1 , servicestack.redis 5.9.2 , the below code works fine.
public partial class AppHost
{
public void RegisterCache(Container container)
{
//4. Registering the session cache.
container.Register<ICacheClient>(new MemoryCacheClient());
container.Register<IRedisClientsManager>(
c => new PooledRedisClientManager($"password@127.0.0.1:1234"));
container.Register(c =>
c.Resolve<IRedisClientsManager>().GetCacheClient());
}
}
public IActionResult Index()
{
var userName = "admin";
using var authService = ResolveService<AuthenticateService>();
authService.Authenticate(new Authenticate
{
provider = CredentialsAuthProvider.Name,
UserName = userName,
Password = userName + "123456",
RememberMe = true
});
}
After upgrade to servicestack 5.10 , no code changes, works wrong
If I comment the below code , works fine , but become not used the redis , I think there are error in RedisClient, please help, thanks.
//container.Register(c => c.Resolve<IRedisClientsManager>().GetCacheClient());