title: Linq: adding conditions to the where clause conditionally
body: <p>I have a query like this</p>
  
  <pre><code>(from u in DataContext.Users
         where u.Division == strUserDiv 
         &amp;&amp; u.Age &gt; 18
         &amp;&amp; u.Height &gt; strHeightinFeet  
         select new DTO_UserMaster
         {
           Prop1 = u.Name,
         }).ToList();
  </code></pre>
  
  <p>I want to add the various conditions like age, height based on whether those conditions were provided to the method running this query. All conditions will include user Division. If age was supplied I want to add that to the query. Similarly, if height was provided I want to add that as well. </p>
  
  <p>If this were to be done using sql queries I would have used string builder to have them appended to the main strSQL query. But here in Linq I can only think of using an IF condition where I will write the same query thrice, with each IF block having an additional condition. Is there a better way to do this?</p>