Mid
ASP.NET Core
ASP.NET Core
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"
));
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png