title: C# Lambda WhereIf or statement
body: <p>I have many unknown search parameters to evaluate.   At most I would only have 5 search levels currently just showing 3 levels. 
  I have been trying to use the WhereIf extension but perhaps thats not not the best way.  I would prefer a solution in a lambda or linq statement.   Here is a mock up:</p>
  
  <p><a href="https://i.stack.imgur.com/8MQ4b.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8MQ4b.jpg" alt="enter image description here"></a></p>
  
  <p>Consider:</p>
  
  <pre><code>Animal_ID    Breed     Color    Age   Weight
  1            Poodle    White      3     10
  2            Shepard   Brown      4     15
  3            Afghan    Brown      9     40
  4            Terrier   White      7     25
  5            Maltese   White      12    14
  </code></pre>
  
  <p>Forgive me, I realize this is incomplete.  I started doing this but then realized this is going to get complex.</p>
  
  <pre><code>List&lt;Animal&gt; animals = db.Animals
    //I know I can do this.   
    //.WhereIf(!String.IsNullOrEmpty("Search"), x =&gt; (x.Color == "white") || (x.Breed == "terrier"))             
    //I want "OR" here
    .WhereIf(!String.IsNullOrEmpty("Search_1_IsSomething"), x =&gt; (x.Color == "white")) // OR
    .WhereIf(!String.IsNullOrEmpty("Search_2_OR_IsSomething"), x =&gt; (x.Breed == "terrier"))
    .ToList();
  </code></pre>
  
  <p>Thanks in advance.</p>