title: How is a Scoped service instance handled in a .NET Core Console application?
body: <p>I copied this from <code>ConfigureServices</code> in a web application I'm building, where I'm trying to move away from the web and only use a console app or service:</p>
  
  <pre><code>serviceCollection.AddScoped&lt;IDbConnection, SqlConnection&gt;(c =&gt; new SqlConnection(App.Configuration.GetConnectionString("DefaultConnection")));
  </code></pre>
  
  <p>The console app works fine, but I'm wondering how the lifetime of the connection is handled. If and when is the connection closed and or disposed? Or does this behave the same as a transient instance, and I should dispose it myself?</p>