title: .Net Core 2 EF core connection string problem
body: <p>this is my appsettings.json</p>
  
  <pre><code> "ConnectionStrings": {
      "Circolari": "Server=abcde;Database=Circolari;Trusted_Connection=True;"
    }
  </code></pre>
  
  <p>and this is my startup.cs</p>
  
  <pre><code> public Startup(IConfiguration configuration, IHostingEnvironment env)
   {
          Configuration = configuration;
          IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
              .SetBasePath(env.ContentRootPath)
              .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
          Configuration = configurationBuilder.Build();
   }
  
  
   // This method gets called by the runtime. Use this method to add services to the container.
  
      public void ConfigureServices(IServiceCollection services)
      {
          //Circolari
          string connectoionString = Configuration.GetConnectionString("Circolari");
          services.AddDbContext&lt;CircolariContext&gt;(options =&gt; options.UseSqlServer(connectoionString));
          services.AddMvc();
      }
  </code></pre>
  
  <p>so when i do a query</p>
  
  <pre><code>using (CircolariContext db = new CircolariContext(new DbContextOptions&lt;CircolariContext&gt;()))
  {
     List&lt;Argomenti&gt; listaArgomenti = db.Argomenti.ToList();
  }
  </code></pre>
  
  <p>i have the problem: An unhandled exception occurred while processing the request.</p>
  
  <p>InvalidOperationException: A named connection string was used, but the name 'Circolari' was not found in the application's configuration. Note that named connection strings are only supported when using 'IConfiguration' and a service provider, such as in a typical ASP.NET Core application. See <a href="https://go.microsoft.com/fwlink/?linkid=850912" rel="noreferrer">https://go.microsoft.com/fwlink/?linkid=850912</a> for more information.</p>
  
  <p>Microsoft.EntityFrameworkCore.Storage.Internal.NamedConnectionStringResolverBase.ResolveConnectionString(string connectionString)</p>
  
  <p>could someone help me please?</p>