Reading Configuration

Say I have a class like this:
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
}
Was this page helpful?