title: "Error Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time"
body: <p>I'm creating a ASP .NET Core Web API using  VS 2019 preview and .NET Core 3.0.
  When I try execute : add-migration, I'm getting the error :
  <em>"Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time,..."</em></p>
  
  <p>Below is my context file:</p>
  
  <pre><code>  public class AppDbContext : DbContext
    {
       public AppDbContext(DbContextOptions&lt;AppDbContext&gt; options) : base(options)
          { }
       public DbSet&lt;Categoria&gt; Categorias { get; set; }
       public DbSet&lt;Produto&gt; Produtos { get; set; }
    }
  </code></pre>
  
  <p>My ConfigureServices method:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
    services.AddDbContext&lt;AppDbContext&gt;(options =&gt; options.UseMySql(Configuration.GetConnectionString("DefaultConnection")));
  
    services.AddControllers().AddNewtonsoftJson();
  }
  </code></pre>
  
  <p>My appsettings.json</p>
  
  <pre><code>{
    "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;DataBase....."
    },
  ...
  }
  </code></pre>
  
  <p>I always using this approach and it works.</p>
  
  <p>I also tried create a empty constructor in context class and the I got this error : 
  <em>"System.InvalidOperationException: No database provider has been configured for this DbContext..."</em></p>
  
  <p>Am I forgetting some detail ?</p>
  
  <p>note: This works fine in ASP .NET Core 2.2</p>