Skip to content

Instantly share code, notes, and snippets.

@configureappio
Created April 3, 2018 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save configureappio/e2afd62b066f48196b94892c4f2fe8e2 to your computer and use it in GitHub Desktop.
Save configureappio/e2afd62b066f48196b94892c4f2fe8e2 to your computer and use it in GitHub Desktop.
services.AddScoped<IAppSettingsResolved, MyAppSettingsBridge>();
// add the other interfaces implemented by MyAppSettingsBridge to allow for resolution by those interfaces (interface segregation)
services.AddScoped<IAppSettings>(provider => provider.GetService<IAppSettingsResolved>());
services.AddScoped<ISqlConnectionSettings>(provider => provider.GetService<IAppSettingsResolved>());
services.AddScoped<IOracleConnectionSettings>(provider => provider.GetService<IAppSettingsResolved>());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment