title: How to conditionally pass parameters into a func array
body: <p>I have method that expects the following parameters:</p>
  
  <pre><code>public IQueryable&lt;TEntity&gt; GetAllIncluding(params Expression&lt;Func&lt;TEntity, object&gt;&gt;[] includeProperties)
  {
      foreach (var includeProperty in includeProperties)
      {
          dbSet.Include(includeProperty);
      }
      return dbSet;
  }
  </code></pre>
  
  <p>Here's how I pass in my params:</p>
  
  <pre><code>IQueryable&lt;User&gt; users = repo.GetAllIncluding(u =&gt; u.EmailNotices, u =&gt; u.EmailTemplatePlaceholders, u =&gt; u.Actions);
  </code></pre>
  
  <p>However, I need to be able to check certain conditions before I pass them in or not.</p>
  
  <p>For example, if I have a variable <code>useEmailNotices = false</code>, then I don't want to pass in <code>EmailNotices</code> but if it's <code>true</code> then I do.  I need to do this for all three.  I know there's a long way to do this but I was hoping that there was a one line short way or a param builder function or something of that nature.</p>