title: Combine multiple where conditions having optional parameters in C# linq?
body: <p>I am searching for a LINQ query where I have 3 parameters and two are optional parameters for this I wrote if-else conditions like below</p>
  
  <pre><code>if (id != null) { where condition} 
  else if (name!= null) { where condition } 
  else if (category != null) { where condition } 
  else if (id != null &amp;&amp; name != null) { where condition } 
  else if (id != null &amp;&amp; category != null) { where condition } 
  else if (name != null &amp;&amp; category != null) {where condition} 
  else if (id != null &amp;&amp; name != null &amp;&amp; category != null ) { where condition } 
  </code></pre>
  
  <p>I don't want to write more if-else conditions if there is another optional parameter added</p>
  
  <p><strong>Note</strong>. Id is not a primary key</p>