JsConfig not applied to Redis Deserialisation


I’ve been using UTC DateTime objects throughout my projects with JsConfig set to:

JsConfig.AlwaysUseUtc = true;
JsConfig.AssumeUtc = true;

Which works as expected for everything except when using IRedisClient:

Redis.Get<MyObject> ("key");

Where MyObject type has a DateTime, that property is coming back as Kind = Local

However if I deserialise without using the Redis.Get<T> method, the ‘Kind’ = ‘Utc’ as expected

var json = Redis.Get<string>("key");
var object = json.FromJson<MyObject>();

How can I get Redis to honour the JsConfig settings?


It should be using JsConfig for its JSON Serialization, can you provide sample code showing where the issue is?

Sorry, I messed up. The worker process hadn’t updated properly, so the JsConfig wasn’t set in that build.
It’s totally working. :dizzy_face: I need to take a break. Thanks Demis.


1 Like