title: AddDbContext not available in IServiceCollection in .NET Core
body: <p>I have .NET Core 2 project in Visual Studio 2017. I am trying to add (Postgresql) database connection. Here is a code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddDbContext(options =&gt;
          options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection")));
  
      // Add framework services.
      services.AddMvc();
  }
  </code></pre>
  
  <p>But compiler complains with this message:</p>
  
  <blockquote>
    <p>IServiceCollection does not contain a definition for 'AddDbContext'
    and no extension method 'AddDbContext' accepting a first argument of
    type 'IServiceCollection' could be found (are you missing a using
    directive or an assembly reference?)</p>
  </blockquote>
  
  <p>I installed NuGet package Npgsql. I also tried to install NuGet package EntityFramework, but I'm receiving error:</p>
  
  <p>Package restore failed. Rolling back package changes for 'MyProject'.</p>
  
  <p>Is this the root of my problem? Should I install some other library?</p>
  
  <p>On this <a href="https://stackoverflow.com/questions/37569990/iservicecollection-does-not-contain-a-definition-or-extension-for-addnpgsql">question</a> procedures AddEntityFramework() and AddEntityFrameworkNpgsql() are used, but those two are also not recognized by compiler in my project.</p>