title: DotNet Core setting the connection string after startup has run
body: <p>I have a Visual Studio solution that has two database connections. The first is a catalog holding username password and database. The second will be the users data. I can set up the connection for the catalog database in "ConfigureServices" and thats fine. Once the user has attempted to log in and succeeded I can then know the database the user will connect to.</p>
  
  <p>My problem is, How do I create the service after startup has run.. how do I use the connection string to add a DBcontext in the normal course of operations. From my searches this is OK if you know the connection string at start up..</p>
  
  <pre><code>var connection = @"Server=(localdb)\mssqllocaldb;Database=JobsLedgerDB;Trusted_Connection=True;ConnectRetryCount=0";
  services.AddDbContext&lt;BloggingContext&gt;(options =&gt; options.UseSqlServer(connection));
  </code></pre>
  
  <p>But if I dont have a connection string at startup... How do I add a service after the project is already up and running when I finally do have the connection string?</p>