Built-in features · v1.0.2

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.BuiltInFeatures
Shipped today

CORS, 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.

Program.cs
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 Order
Configuration

Every 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.

appsettings.json
{
  "PowerFeatures": {
    "Cors": {
      "Enabled": true,
      "AllowedOrigins": [ "https://example.com", "https://app.example.com" ],
      "AllowedMethods": [ "GET", "POST", "PUT", "DELETE" ],
      "AllowedHeaders": [ "Authorization", "Content-Type" ],
      "AllowCredentials": false
    }
  }
}
Replaceable by design

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

    planned

    Attaches and propagates a correlation ID across a request's lifetime for tracing.

  • SecurityHeaders

    planned

    Applies standard security response headers without hand-rolling middleware.

  • ExceptionHandling, Sanitization, HealthChecks

    planned

    Additional low-complexity, flag-toggled capabilities on the roadmap for future releases.