title: Only get specific columns
body: <p>Can I make my EF objects retrieve only specific columns in the sql executed?  If I am executing the below code to retrieve objects, is there something I can do to only get certain columns if wanted?</p>
  
  <pre><code>public IEnumerable&lt;T&gt; GetBy(Expression&lt;Func&lt;T, bool&gt;&gt; exp)
  {
      return _ctx.CreateQuery&lt;T&gt;(typeof(T).Name).Where&lt;T&gt;(exp);
  }
  </code></pre>
  
  <p>This would generate a select clause that contains all columns.  But, if I have a column that contains a large amount of data that really slows down the query, how can I have my objects exclude that column from the sql generated?</p>
  
  <p>If my table has Id(int), Status(int), Data(blob), how can I make my query be</p>
  
  <pre><code>select Id, Status from TableName
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>select Id, Status, Data from TableName
  </code></pre>
  
  <p>From the suggestion below, my method is</p>
  
  <pre><code>public IEnumerable&lt;T&gt; GetBy(Expression&lt;Func&lt;T, bool&gt;&gt; exp, Expression&lt;Func&lt;T, T&gt;&gt; columns)
  {
      return Table.Where&lt;T&gt;(exp).Select&lt;T, T&gt;(columns);
  }
  </code></pre>
  
  <p>And I'm calling it like so</p>
  
  <pre><code>mgr.GetBy(f =&gt; f.Id &lt; 10000, n =&gt; new {n.Id, n.Status});
  </code></pre>
  
  <p>However, I'm getting a compile error: </p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'AnonymousType#1' to 'Entities.BatchRequest'</p>
  </blockquote>