Skip to main content

What is the purpose of IOptions, IOptionsSnapshot, and IOptionsMonitor?

Senior .NET Core
Quick Answer IOptions is singleton รขโ‚ฌโ€ reads config at startup. IOptionsSnapshot is scoped รขโ‚ฌโ€ reflects config changes between requests (requires file-based config with reloadOnChange: true). IOptionsMonitor is singleton with a reactive change callback รขโ‚ฌโ€ use it in singletons that need to react to configuration changes without restarting.

Answer

IOptions: Singleton config.
IOptionsSnapshot: Reload per request.
IOptionsMonitor: Real-time config with change notifications.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice