title: .Net Core Dependency Injection IdbConnection
body: <p>I have a .NET MVC app that uses autofac for Dependency Injection.
  When the app starts the following code registers IDbConnection</p>
  
  <pre><code>var connectionString =  ConfigurationManager.ConnectionStrings["DBConnectionStringName"].ConnectionString;
  this.Register(c =&gt; new SqlConnection(connectionString)).As&lt;IDbConnection&gt;().InstancePerRequest();
  </code></pre>
  
  <p>I am trying to find how to do the same in .Net Core MVC using the default dependency injection mechenism that the framework offers.
  I am thinking of adding something like this</p>
  
  <pre><code> public void ConfigureServices(IServiceCollection services)
          {
              services.AddTransient&lt;IDbConnection, SqlConnection&gt;();
  </code></pre>
  
  <p>but I don't know where to add the connection string</p>