You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Post-configuration support**: `PostConfigure` callbacks for normalizing/transforming values after binding (e.g., path normalization, URL lowercase)
303
303
-**ConfigureAll support**: Set common default values for all named options instances before individual binding with `ConfigureAll` callbacks (e.g., baseline retry/timeout settings)
304
304
-**Named options support**: Multiple configurations of the same options type with different names (e.g., Primary/Secondary email servers)
305
+
-**Child sections**: Simplified syntax for creating multiple named instances from subsections using `ChildSections` property (e.g., `Email` → Primary/Secondary/Fallback)
305
306
-**Nested subsection binding**: Automatic binding of complex properties to configuration subsections (e.g., `StorageOptions.Database.Retry` → `"Storage:Database:Retry"`) - supported out-of-the-box by Microsoft's `.Bind()` method
These features would improve usability but are not critical.
668
670
669
-
### 8. Options Snapshots for Specific Sections
671
+
### 8. Child Sections (Simplified Named Options)
670
672
671
673
**Priority**: 🟢 **Low-Medium**
672
-
**Status**: ❌ Not Implemented
674
+
**Status**: ✅ **Implemented**
675
+
**Inspiration**: Community feedback on reducing boilerplate for multiple named instances
676
+
677
+
**Description**: Provide a simplified syntax for creating multiple named options instances from configuration subsections. Instead of writing multiple `[OptionsBinding]` attributes for each named instance, developers can use a single `ChildSections` property.
678
+
679
+
**User Story**:
680
+
> "As a developer, I want to configure multiple related named options (Primary/Secondary/Fallback servers, Email/SMS/Push channels) without repeating multiple attribute declarations."
**Description**: Support binding multiple sections dynamically at runtime using `IOptionsSnapshot`.
840
+
-**Expansion at extraction time**: ChildSections array is expanded into multiple OptionsInfo instances during attribute extraction, not at code generation. This simplifies generator logic and ensures all features work consistently.
841
+
-**No OnChange support**: Like regular named options, ChildSections-based instances don't support OnChange callbacks (use `IOptionsMonitor<T>.OnChange()` manually if needed).
0 commit comments