AspNetCoreFromZeroToOverkill / GroupManagement

MIT License
29 stars 15 forks source link

DbInitializer should get environments as an argument #26

Closed joaofbantunes closed 4 years ago

joaofbantunes commented 5 years ago

Instead of having the environments in which the migrations run on startup hardcoded, DbInitializer should receive them as arguments in the constructor, probably in a settings object.

romanolester commented 5 years ago

How should we do this? Do we declare the variable in our config? How do we create the settings object?

joaofbantunes commented 5 years ago

One of the project's episodes was dedicated to that topic 😆 You can check it out here.

But in summary, yes, we should create a new class to represent the DbInitializer settings, which will probably contain a string[] with the environments. We add it to the appsettings.json file, and in the Startup class we configure it to be used.

romanolester commented 5 years ago

Will submit a pull request on what is on my mind on this. .😁

joaofbantunes commented 4 years ago

Solved during migration to .NET Core 3.0.