关注开源代码的实际应用
一、在存储对象时,先进行Indexed配置:
Db4objects.Db4o.Config.IConfiguration conf = Db4oFactory.Configure();
conf.ObjectClass(typeof(Data)).ObjectField("Key").Indexed(true);
二、查询的时候选择方式①进行查询,而不要用方式②:
①:
Data d = new Data();
d.Key = key;
d = (Data)db.Get(d).Next();
②:
IList<Data> list = db.Query<Data>(delegate(Data d)
{
return d.Key == key;
});