1
我有下面的類:servicestack.redis不保存字典物業
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; }
}
}
我保存的Redis這個類的一個對象與多個對象的ImportanceCollection。然後當我從緩存中再次得到它爲空。
我使用RedisClient作爲ICacheClient。
任何想法?或者RedisClient不保存字典屬性?
感謝
那麼我能做什麼,如果我想存儲一個對象與私人成員,並在稍後從緩存中獲取它? – Omri