title: How to query data asynchronously with Ef Core?
body: <p>Imagine you have a variable <code>databaseContext</code> and want to select all users from the users table. From the docs</p>
  <p><a href="https://docs.microsoft.com/en-us/ef/core/querying/" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/ef/core/querying/</a></p>
  <p>you might create this method:</p>
  <pre><code>public IEnumerable&lt;User&gt; GetUsers() =&gt; _databaseContext.Users;
  </code></pre>
  <p>but isn't that synchronous code? And I think this is completely wrong:</p>
  <pre><code>public Task&lt;User[]&gt; GetUsers() =&gt; _databaseContext.Users.ToArrayAsync();
  </code></pre>
  <p>I would expect a method like this:</p>
  <pre><code>public Task&lt;IEnumerable&lt;User&gt;&gt; GetUsers() =&gt; _databaseContext.Users /* but select them asynchronously */;
  </code></pre>
  <p>Since EF Core provides synchronous and asynchronous methods e.g. <code>Find</code> and <code>FindAsync</code> I don't know how to query all data asynchronously. Maybe EF Core does this under the hood somehow but then I should have to await it, right?</p>