我有以下课程:
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; }
}
}
我将具有多个对象的 ImportanceCollection 保存到 Redis 此类的对象。然后当我再次从缓存中获取它时为空。
我正在使用 RedisClient 作为 ICacheClient。
有任何想法吗?还是 RedisClient 不保存字典属性?
谢谢