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
-**Configuration change callbacks**: Auto-generated IHostedService for OnChange notifications with Monitor lifetime - perfect for feature flags and runtime configuration updates
302
+
-**Post-configuration support**: `PostConfigure` callbacks for normalizing/transforming values after binding (e.g., path normalization, URL lowercase)
302
303
-**Named options support**: Multiple configurations of the same options type with different names (e.g., Primary/Secondary email servers)
303
304
-**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
-**🎯 Custom Validation**: Support for `IValidateOptions<T>` for complex business rules beyond DataAnnotations
322
322
-**🔔 Configuration Change Callbacks**: Auto-generated IHostedService for OnChange notifications with Monitor lifetime - perfect for feature flags and runtime config updates
323
+
-**🔧 Post-Configuration Support**: Normalize or transform values after binding with `PostConfigure` callbacks (e.g., ensure paths have trailing slashes, lowercase URLs)
323
324
-**📛 Named Options**: Multiple configurations of the same options type with different names (e.g., Primary/Secondary email servers)
324
325
-**🎯 Explicit Section Paths**: Support for nested sections like `"App:Database"` or `"Services:Email"`
325
326
-**📂 Nested Subsection Binding**: Automatic binding of complex properties to configuration subsections (e.g., `StorageOptions.Database.Retry` → `"Storage:Database:Retry"`)
@@ -422,6 +423,9 @@ public class MyService
422
423
| ATCOPT005 | OnChange not supported with named options |
423
424
| ATCOPT006 | OnChange callback method not found |
424
425
| ATCOPT007 | OnChange callback has invalid signature |
426
+
| ATCOPT008 | PostConfigure not supported with named options |
427
+
| ATCOPT009 | PostConfigure callback method not found |
428
+
| ATCOPT010 | PostConfigure callback has invalid signature |
-**🎯 Custom validation** - Support for `IValidateOptions<T>` for complex business rules beyond DataAnnotations
746
746
-**🚨 Error on missing keys** - Fail-fast validation when configuration sections are missing (`ErrorOnMissingKeys`) to catch deployment issues at startup
747
747
-**🔔 Configuration change callbacks** - Automatically respond to configuration changes at runtime with `OnChange` callbacks (requires Monitor lifetime)
748
+
-**🔧 Post-configuration support** - Normalize or transform values after binding with `PostConfigure` callbacks (e.g., ensure paths have trailing slashes, lowercase URLs)
748
749
-**📛 Named options** - Multiple configurations of the same options type with different names (e.g., Primary/Secondary email servers)
749
750
-**🎯 Explicit section paths** - Support for nested sections like `"App:Database"` or `"Services:Email"`
@@ -1324,6 +1325,159 @@ The generator performs compile-time validation of OnChange callbacks:
1324
1325
1325
1326
---
1326
1327
1328
+
### 🔧 Post-Configuration Support
1329
+
1330
+
Automatically normalize, validate, or transform configuration values after binding using the `PostConfigure` property. This feature enables applying defaults, normalizing paths, lowercasing URLs, or computing derived properties.
1331
+
1332
+
**Requirements:**
1333
+
- Cannot be used with named options
1334
+
- Callback method must have signature: `static void MethodName(TOptions options)`
0 commit comments