【发布时间】:2013-12-11 22:44:36
【问题描述】:
如果我缓存 List<string> 并执行 Get,我将返回四个项目及其值(如预期的那样)。如果我缓存 List<PortedNumberCollection> 并执行 Get- 我得到正确数量的项目,但所有值(MSISDN、RoutingLabel、RouteAction)都是空的,为什么?
[DataContract]
public class PortedNumberCollection
{
[DataMember]
public Int64 PortedID;
[DataMember]
public string MSISDN;
[DataMember]
public string RoutingLabel;
[DataMember]
public string RouteAction;
}
string host = "localhost";
RedisClient redi = new RedisClient(host);
//List<string> PorCol = new List<string> {
// "Hi there",
// "Hello world",
// "Many name is",
// "Uh, my name is"
//};
List<PortedNumberCollection> PorCol = MobileDAL.ReadPortedNumberCollection();
redi.Set("PorColCache", PorCol);
//List<string> msgs = redi.Get<List<string>>("PorColCache");
List<PortedNumberCollection> msgs = redi.Get<List<PortedNumberCollection>>("PorColCache");
【问题讨论】:
-
将此作为答案,您将获得积分。你的建议奏效了。