C# ASP.NET Core 2.0 error running selected code generator

If you are "Adding a New Controller"...

If you are using Visual Studio 2017 and are running the new Core 2.0 framework you may have had an error that reads...


Error
There was an error running the selected code generator: 'No database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions object in it constructor and passes it to the base constructior for DbContext.'

If you are using your own DbContext(s) for different entities (in my case I have the entity classes defined in a different project for reuse) then add a new DbContext class.

1.  Add new Class (standard place for base template...not 'Features' template) is in the Data directory.
2.  Name it Controller where is the name of your entity class.
3.  The most basic constructor that you will generally use will take in DbContextOptions...this allows you to send in the sql connection string to base(options).  "base" being the base DbContext class Microsoft provides.
4.  In my case there is a good chance that my class is going to point at Azure Cosmos Db for this particular entity.  So separation is necessary.  I am also adding my custom dbcontext into the ConfigureServices method of the Startup.cs file (Startup class necessary in Core2).

Hope this helps...