IOptionsMonitor<T>
The singleton options interface whose CurrentValue always reflects the latest configuration and whose OnChange callback fires on reload.
In more detail
It is registered as a singleton and can be injected anywhere. Use it in a singleton that must notice a settings change while the app runs.
Related terms
- IOptions<T> — The options interface that gives a singleton view of an options class, bound once and never recomputed for the life of the process.
- IOptionsSnapshot<T> — The options interface registered as scoped, recomputed once per scope, so in a web app an edited setting appears on the next request.
- singleton — A service lifetime, or design, in which one instance is created and shared for the whole life of the process.
- callback function — A function you hand to other code so that it can call it later, for example when a timer fires or an event happens.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices