title: Select specific table columns to list async using EF Core
body: <p>I have a table called CarMakes with a number of columns:</p>
  
  <ul>
  <li>Id</li>
  <li>Name</li>
  <li>DateCreated</li>
  <li>etc..</li>
  </ul>
  
  <p>I would like to retrieve all these records in the table, but only the Id and Name columns (such that the generated SQL only retrieves these specific columns). This must also be executed asynchronously.</p>
  
  <p>However, I can see that it can be done async for single entities but I'm having some trouble figuring out how to do this as an async list.</p>
  
  <p>I have the following generic method which returns a task of <code>IEnumerable&lt;T&gt;</code> where <code>T</code> is <code>CarMake</code>:</p>
  
  <pre><code>public async Task&lt;IEnumerable&lt;T&gt;&gt; GetAllAsync(params Expression&lt;Func&lt;T, object&gt;&gt;[] navigationProperties)
  {
      IQueryable&lt;T&gt; query = Context.Set&lt;T&gt;();
      query = navigationProperties.Aggregate(query, (current, navigationProperty) =&gt; current.Include(navigationProperty));
      IEnumerable&lt;T&gt; entities = await query.ToListAsync();
      return entities;
  }
  </code></pre>
  
  <p>How would I modify this method to only generate sql to get the specific fields I want?</p>