Oguz Karadenizli
Oguz Karadenizli

Reputation: 3505

Non-generic Store method or non-generic GetTypedClient for ServiceStack Redis Client

I have an object, I don't know it's type in DesignTime. I have to persist it to Redis Db.

I need non-generic Store method or non-generic GetTypedClient(Type t) method.

There is internal _StoreAll method so I could not use.

Using As impossible because I don't know object's type in design-time

Any idea?

Upvotes: 1

Views: 658

Answers (1)

mythz
mythz

Reputation: 143389

I've just added StoreObject to ServiceStack.Redis which lets you do this. This is available on v3.83 which is also published to NuGet.

You could do this manually by just serializing the object to JSON and store it a key of your choosing using the RedisClient's SetEntry method - Which also what happens behind the scenes when you use the Generic API.

Upvotes: 1

Related Questions