title: How to configure UseSqlServer?
body: <p>I'm trying to configure the app to use my class (derived from <code>DbContext</code>) <code>ApplicationDbContext</code> to connect to my database. I already made the configuration file <code>appsetting.json</code>:</p>
  
  <pre><code>"Data": {
      "SportStoreProducts": {
          "ConnectionStrings":"Server=(localdb)\\MSSQLLocalDB;Database=SportStore;Trusted_Connection=True;MultipleActiveResultSets=true"
      }
  }
  </code></pre>
  
  <p>I used dependency injection to pass the object implementing <code>IConfiguration</code> (which is <code>appsetting.json</code>) through Startup construction :</p>
  
  <pre><code>public class Startup
  {
      public Startup(IConfiguration configuration) =&gt; Configuration = configuration;
  
      public IConfiguration Configuration { get; }
  }
  </code></pre>
  
  <p>Now I want to use this configuration file in <code>ConfigureServices</code> method of <code>Startup</code> and use extension method <code>AddDbContext</code> to register my <code>ApplicationDbContext</code> to use the SQL database (<code>SportStore</code>) I assigned in the configuration file :</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
          services.AddDbContext&lt;ApplicationDbContext&gt;(
              options =&gt; options.UseSqlServer(***);
  }
  </code></pre>
  
  <p>My question is that what should I pass into the <code>UseSqlServer</code> method as parameters (***) so it can connect context to the SQL Server database using my supplied configuration property?</p>