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 cannot do it like this because I need 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();
The result is
- full listing of all colors
- filter by name.
This is not the solution I was striving for. Any suggestions?
source
share