Hi,
Can we use foreach loop for Iqueryable object?
I'd like to do something as follow:
query = Iqueryable<Myclass> = objDataContext.Myclass; // objDataContext is an object of LINQ datacontext class
int[] arr1 = new int[] { 3, 4, 5 };
foreach (int i in arr1)
{
query = query.Where(q => (q.f_id1 == i || q.f_id2 == i || q.f_id3 == i));
}
It gives me wrong output as each time value if i is changed.