In linq to sql i can do like this:
var q = db.Colors;
if(! string.IsNullOrEmpty(colorName))
q = q.Where(c=>c.Name.Equals(colorName));
return q.ToList();
In Db4O linq I can't do it like this because I have to start with
var q = (from Color c in db
select c);
if(! string.IsNullOrEmpty(colorName))
q = q.Where(c=>c.Name.Equals(colorName));
return q.ToList();
This results in
- a complete enumeration of ALL the colors
- a filter by name.
That's not the solution I was aiming for off course. Any suggestions?