Reading Configuration

Say I have a class like this:
public StepGenerator(MigrationSteps migration)
{
this.Migration = migration;
}
public StepGenerator(MigrationSteps migration)
{
this.Migration = migration;
}
I want it to read some settings from appsettings.json, however I cant Dependency Inject the configuration, because it requires that class of MigrationSteps. What is a smart way to passing in the configuration? Just pass the config along in the constructor?
public StepGenerator(MigrationSteps migration, IOption<SQLConfiguration> sqlConfig){
// emitted
}
public StepGenerator(MigrationSteps migration, IOption<SQLConfiguration> sqlConfig){
// emitted
}
0 Replies
No replies yetBe the first to reply to this messageJoin