title: Async provider in .NET Core DI
body: <p>I'm just wondering if it's possible to have <code>async/await</code> during DI. </p>
  
  <p>Doing the following, the DI fails to resolve my service.</p>
  
  <pre><code>services.AddScoped(async provider =&gt; 
  {
    var client = new MyClient();
    await client.ConnectAsync();
    return client;
  });
  </code></pre>
  
  <p>where as the following works perfectly fine.</p>
  
  <pre><code>services.AddScoped(provider =&gt; 
  {
    var client = new MyClient();
    client.ConnectAsync().Wait();
    return client;
  });
  </code></pre>