Using Options pattern (IOptions, IOptionsSnapshot,?
IOptionsMonitor)
- IOptions<T>: For singleton/config services.
- IOptionsSnapshot<T>: Scoped; updates per request.
- IOptionsMonitor<T>: Singleton; can react to config changes.
services.Configure<MySettings>(Configuration.GetSection("MySettings"
));