I have the following class:
public class UserSettings : IMongoEntity
{
[BsonId]
public ObjectId _id { get; private set; }
[BsonElement("Uid")]
public ObjectId UserId { get; set; }
private Dictionary<string, StatusImportance> _imp;
protected Dictionary<string, StatusImportance> ImportanceCollection
{
get {
if(_imp == null)
_imp = new Dictionary<string, StatusImportance>();
return _imp;
}
set { _imp = value; }
}
}
I save to Redis an object of this class with an ImportanceCollection with more than one object. Then when I get it again from the cache is null.
I’am using a RedisClient as a ICacheClient.
Any Ideas? Or RedisClient does not save dictionary properties?
Thanks
ServiceStack’s C# Redis Client uses ServiceStack’s JsonSerializer which only serializes public members by default.