dotnet-options-pattern
Installation
SKILL.md
Options Pattern for .NET Configuration
Overview
The Options pattern provides strongly-typed access to configuration groups:
- IOptions - Singleton, read once at startup
- IOptionsSnapshot - Scoped, reloads per request
- IOptionsMonitor - Singleton, real-time change notifications
Quick Reference
| Interface | Lifetime | Supports Reload | Named Options | Use Case |
|---|---|---|---|---|
IOptions<T> |
Singleton | No | No | Static config |
IOptionsSnapshot<T> |
Scoped | Yes | Yes | Request-scoped config |
IOptionsMonitor<T> |
Singleton | Yes | Yes | Singleton services, change notifications |