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.
In more detail
Read its Value property to get the bound options object. It is the right default for most code, but it never sees edits to the settings file while the app runs.
Related terms
- 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.
- IOptionsMonitor<T> — The singleton options interface whose CurrentValue always reflects the latest configuration and whose OnChange callback fires on reload.
- options pattern — Binding a configuration section to a plain class with typed properties, validating it, and injecting it into services instead of reading raw strings.
- singleton — A service lifetime, or design, in which one instance is created and shared for the whole life of the process.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices