title: Dependency Injection: Injecting configuration in .Net Core 2.0
body: <p>I'm migrating some old software to .Net core 2.0 ...</p>
  
  <p>I'd like to inject a connection string in my class DBActivityRepository from a base class...</p>
  
  <p>Should I just pass the configuration in the creation of the base class </p>
  
  <pre><code>this._DBHandler = new DBHandler(configuration);
  </code></pre>
  
  <p>or is it better to do it this way:</p>
  
  <pre><code>private DBHandler _DBHandler;
  private string connectionString;
  public DBActivityRepository(IConfiguration configuration) : base(configuration)
  {
      // **Do I need this?**
      this._DBHandler = new DBHandler(configuration);
      connectionString = this._DBHandler.GetConnectionString();
  }
  </code></pre>
  
  <p>Thanks</p>