One bundle, zero third-party dependencies, config-only toggles
PowerCSharp.BuiltInFeatures depends only on the engine and Microsoft.AspNetCore.App — every capability ships in the bundle, and a flag decides whether it does anything.
$ dotnet add package PowerCSharp.BuiltInFeaturesCORS, toggled entirely through configuration
FeatureKey "Cors", module CorsFeatureModule, Order 10, default disabled. options.AddBuiltInFeatures() is sugar for scanning the bundle assembly — no special-casing in the engine.
builder.Services.AddPowerFeatures(builder.Configuration, options =>
{
options.AddBuiltInFeatures(); // opts the bundle into auto-discovery
});
var app = builder.Build();
app.UsePowerFeatures(); // applies enabled built-ins' middleware in OrderEvery setting lives under one config section
Enabled, AllowedOrigins, AllowedMethods, AllowedHeaders, and AllowCredentials all resolve through the same composite flag chain as every other PowerCSharp feature — appsettings, environment variables, or a code override.
{
"PowerFeatures": {
"Cors": {
"Enabled": true,
"AllowedOrigins": [ "https://example.com", "https://app.example.com" ],
"AllowedMethods": [ "GET", "POST", "PUT", "DELETE" ],
"AllowedHeaders": [ "Authorization", "Content-Type" ],
"AllowCredentials": false
}
}
}Disable a built-in, drop in your own implementation
Any built-in can be disabled via its flag and replaced by a custom IFeatureModule registered with the same FeatureKey. The built-in is skipped and the custom module runs instead — no forking the package required.
FeatureKey: "Cors"
Built-in CorsFeatureModule disabled via flag → your IFeatureModule registered under the same key runs instead.
On the roadmap
Documented as planned — not yet shipped in the bundle.
CorrelationId
plannedAttaches and propagates a correlation ID across a request's lifetime for tracing.
SecurityHeaders
plannedApplies standard security response headers without hand-rolling middleware.
ExceptionHandling, Sanitization, HealthChecks
plannedAdditional low-complexity, flag-toggled capabilities on the roadmap for future releases.