title: Connection string from appsettings.json to OnConfiguring method in Entity Framework .NET Core
body: <p>As I can see, I cannot access from this method IConfiguration injected object. Also, there's no way to, as I can see, access HttpContext and get in from there. Is there any simple way how can I get the connections string stored in appsettings.json?</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.EntityFrameworkCore;
  using Projekt.Models;
  
  using System.ComponentModel.DataAnnotations;
  using Microsoft.AspNetCore.Http;
  
  namespace Project.DAL
  {
      public class UserContext : DbContext
      {
          
          public DbSet&lt;User&gt; Users {get;set;}
  
  
          protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          {
              string connection_string = &quot;&quot;; //connection string from appsettings.json
              optionsBuilder.UseSqlServer(connection_string);
          }
              
          public class User {
              public string login{ get; set; }
              public string password { get; set; }
  
              
          }
      }
  }
  </code></pre>