I need to be able to add an unkown number of where clauses to a Linq query. Currently I have been trying to combine the queries using Concat(). For example:
var r1 =
from field in db.fields
where ID == 1
select field;
var r2 =
from field in db.fields
where ID == 2
select field
var r3 = r1.Concat(r2);
This is giving me odd results, so I know that there must be a better way to do this. Is there any way to do something along the lines of an "accumulating result"; such as:
r1 = r1 + r2
Where r1 gets all of the results it had before plus all of the results from r2. This would allow me to iterate through a list of "where" filters and combine them as an OR statement would. Thanks to anyone who can help!