title: Migrating DbConnectionFactory from .net to.net core
body: <p>I'm trying to migrate a small .net framework project to .net core one. But I've spent a couple of hours searching how to adopt the code below to .net core 2.0. But I was unlucky, because it seems that System.Data.Common functionality was cut for some reason. So, I've 2 problems here:</p>
  
  <ol>
  <li>How to get provider name from connection string? Do we have ConnectionStringSettings for .net core 2.0</li>
  <li><p>How can we get a factory base only on provider name string?
  Any other thought how to perform loosely coupled db connection factory</p>
  
  <pre><code>public class ConnectionFactory
  {
      protected readonly DbProviderFactory Factory;
  
      protected readonly string ConnectionString;
  
      public ConnectionFactory(string connectionStringName)
      {
          var settings = ConfigurationManager.ConnectionStrings[connectionStringName];
          this.Factory = DbProviderFactories.GetFactory(settings.ProviderName);
          this.ConnectionString = settings.ConnectionString;
      }
  
      public DbConnection Connection
      {
          get
          {
              var con = Factory.CreateConnection();
              con.ConnectionString = this.ConnectionString;
              return con;
          }
      }
  }
  </code></pre></li>
  </ol>