Closed joaofbantunes closed 4 years ago
How should we do this? Do we declare the variable in our config? How do we create the settings object?
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.
Will submit a pull request on what is on my mind on this. .😁
Solved during migration to .NET Core 3.0.
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.