title: LINQ and optional parameters
body: <p>I'm designing a web service to be consumed by an MVC app (pretty simple stuff), but I need a single method in the web service that takes up to four optional parameters (i.e. catId, brandId, lowestPrice and highestPrice). </p>
  
  <p>How do I write the Linq query so that it essentially executes</p>
  
  <pre><code>databaseObject.Products.Where(p=&gt; (p.Category == ANY if catId==null, else catId))
  </code></pre>
  
  <p>I hope that makes sense.</p>