- Options pattern is the default way to map settings from Microsoft.Extensions.Configuration to objects
- Configure using dependency injection
- services.AddOptions().Bind(configuration.GetSection("..."));
- Add validation if needed
- The consumer of a configuration object can decide, how to react on configuration changes
- IOptions: Get the values set when the application started
- IOptionsSnapshop: Get current values
- IOptionsMonitor: Subscribe for configuration changes
- Where you want to react on configuration changes during runtime of the application
- Use Options pattern with IOptions by default
- Use IOptionsSnapshop and IOptionsMonitor where needed. The reaction on configurations changes should be testet