【发布时间】:2009-03-27 13:18:32
【问题描述】:
在 linq to sql 中我可以这样做:
var q = db.Colors;
if(! string.IsNullOrEmpty(colorName))
q = q.Where(c=>c.Name.Equals(colorName));
return q.ToList();
在 Db4O linq 中我不能这样做,因为我必须从头开始
var q = (from Color c in db
select c);
if(! string.IsNullOrEmpty(colorName))
q = q.Where(c=>c.Name.Equals(colorName));
return q.ToList();
这会导致
- 所有颜色的完整枚举
- 按名称过滤。
这不是我想要的解决方案。 有什么建议吗?
【问题讨论】: