Starting with the following LINQ query:
from a in things
where a.Id == b.Id &&
a.Name == b.Name &&
a.Value1 == b.Value1 &&
a.Value2 == b.Value2 &&
a.Value3 == b.Value3
select a;
How can I remove (at runtime) one or more of the conditions in the where clause in order to obtain queries similar to the following ones:
from a in things
where a.Id == b.Id &&
a.Name == b.Name &&
a.Value2 == b.Value2 &&
a.Value3 == b.Value3
select a;
Or
from a in things
where
a.Name == b.Name &&
a.Value3 == b.Value3
select a;