Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of changes required to Startup.cs to use the reader for the configuration mapping and the bridge as the implementation used by controller
public class Startup
{
// Other methods omitted for brevity in example
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddOptions();
// use the reader class to map the configuration
services.Configure<MyAppSettingsReader>(Configuration.GetSection("MyAppSettings"));
// but use the bridge class as the implementation of IMyAppSettings
services.AddTransient<IMyAppSettings, MyAppSettingsBridge>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.