title: how to read connection string from another project appsettings file
body: <p><strong>Project Explaination:</strong></p>
  <p>I'm new to ASP NET CORE. <strong>Using DB First</strong> I have three project in my solution. Which are.</p>
  <blockquote>
  <p>User.API (web api project)</p>
  <p>User.Data (c# class library having database methods and db insatace)</p>
  <p>User.Model (c# class library having scaffolding db context and
  generated model classes)</p>
  </blockquote>
  <p>The request flow is like, Api sends a call to GetUser() Method in <code>Data project</code> then Data project uses Db Context intance and retrieves data.</p>
  <p><strong>Problem:</strong>
  In context file I have</p>
  <pre><code>        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          {
              if (!optionsBuilder.IsConfigured)
              {
                optionsBuilder.UseSqlServer(&quot;Server=.;Database=UserDB;Trusted_Connection=True;&quot;);
              }
          }
  </code></pre>
  <p>I want to use a named connection instead of the hard coded connection string like below</p>
  <pre><code>optionsBuilder.UseSqlServer(&quot;name=UserCloudConnectionString&quot;);
  </code></pre>
  <p>I tried different solutions <a href="https://stackoverflow.com/questions/57243885/appsettings-json-file-not-in-net-core-console-project">like this</a> but could not get it. Which project I have to add a file and where I need add json file in <code>startup.cs</code> file</p>
  <p><strong>Any Help would be much Appreciated.</strong></p>