anveshtummala
anveshtummala

Reputation: 432

Why does RedisManager property removed from ServiceStack/Service.cs file?

Previously we had a RedisManager property in the version of 4.0.50 but in the latest version this property is removed. Can anyone know why it is been removed? What is the replacement for it?

Upvotes: 1

Views: 45

Answers (1)

mythz
mythz

Reputation: 143339

In order to be Multitenancy compatible, the RedisManager was replaced with Redis property which resolves a new IRedisClient instance from GetRedisClient(), the behavior of which can be overridden in your AppHost. This also reduces boilerplate as you can access the Redis instance directly from your Service, e.g:

Redis.SetValue("foo", "bar");
var bar = Redis.GetValue("foo");

If needed the RedisManager property can still be accessed in your Services like any other dependency by adding a public property:

public IRedisClientsManager  RedisManager { get; set; }

Upvotes: 2

Related Questions