title: Asynchronous EF query in F#
body: <p>In C# using EF6 I can easily make asynchronous operations like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>using (var context = new MyDbContext()) {
      var item = await context.SomeEntities.Where(e =&gt; e.Id == 1).FirstAsync();
      DoSomething(item);
  }
  </code></pre>
  
  <p>How could I do the same with F# async workflow?</p>
  
  <p>I am aware of <code>query</code> workflow and how to use it instead of LINQ, but I have no idea how to make it properly async (i.e. without permanent consumption of thread pool, like in a C# example). Here's what I got so far (it is synchronous):</p>
  
  <pre><code>use context = MyDbContext()
  let item = query {
      for e in context.SomeEntities
      where (e.Id = 1)
      head
  }
  DoSomething item
  </code></pre>
  
  <p>I am looking for some operation like <code>headAsync</code> (analogous to <code>FirstAsync</code> in C# query) or other reliable solution.</p>