Is there anyway to join LINQ where clauses as OR ?
var ints = new [] { 1, 3, 5, 7 }; var query = from i in ints select i; query = query.Where (q => q ==
I am trying to do something similar. Here's what I came up with:
//various test cases bool useTestCase1 = true; bool useTestCase2 = true; bool useTestCase3 = false; query = query.Where(q => (q == 3 && useTestCase1 ) || (q == 7 && useTestCase2 ) || (q == 10 && useTestCase3 ) );