title: Ways to manage configuration in project with multiple tiers
body: <p>ASP.NET Core project template comes with <code>appsettings.json</code> and <code>appsettings.Development.json</code> and it is added by default in <a href="https://github.com/aspnet/MetaPackages/blob/dev/src/Microsoft.AspNetCore/WebHost.cs#L171" rel="noreferrer">CreateDefaultBuilder</a>. </p>
  
  <p>Because the project with <code>DbContext</code> is separate from my ASP.NET Core project (<code>MyProject.Data</code>) I am required to implement <code>IDesignTimeDbContextFactory</code> for my context in order for commands like <code>Add-Migration</code> and <code>Update-Database</code> to work. I don't want to hardcode my connection string for my <code>IDesignTimeDbContextFactory</code> but re-use the config in both projects.</p>
  
  <p>I have few solutions for it but I want to know what's the most reasonable based on your experiences and opinions.</p>
  
  <ul>
  <li>Implement <code>IDesignTimeDbContextFactory</code> in my ASP.NET Core (UI layer) project.</li>
  <li>Implement <code>IDesignTimeDbContextFactory</code> in my <code>MyProject.Data</code> project, and move <code>appsettings.json</code> to some root directory, or <code>configuration</code> (located at root) directory shared between projects.</li>
  <li>Create separate configuration file for database like <code>database.json</code> put it alongside my <code>.sln</code> file.</li>
  </ul>
  
  <p>How should I share this?</p>
  
  <p>EDIT:</p>
  
  <p>There's similar question and answer here: <a href="https://stackoverflow.com/questions/38356990/connectionstring-from-appsettings-json-in-data-tier-with-entity-framework-core">ConnectionString from appsettings.json in Data Tier with Entity Framework Core</a> but it doesn't answer my question. It doesn't say anything about data tier at all. I don't want to re-use logic for adding db context. <strong>I want to re-use connection string in two projects</strong> to avoid duplicating connection strings.</p>