SaveApis.Framework

Documentation for SaveApis.Framework

View on GitHub

ControllerInstaller — Web

Key: Controller
Default Enabled:
Package: SaveApis.Framework.Web


Purpose

Registers ASP.NET Core MVC controllers, adds controller application parts from the configured assemblies, configures JSON serialization for enums, and maps all controllers with global RequireAuthorization() in the pipeline.


What It Does

Builder phase:

Application phase:


Dependencies

Dependency Direction Requirement Description
AuthenticationInstaller After Optional Auth middleware should be present for RequireAuthorization()
AuthorizationInstaller After Optional Authorization services must be registered
ZitadelInstaller After Optional Zitadel scheme should be registered before controllers are mapped
OpenApiInstaller Before Optional OpenAPI should run after controllers are registered
ScalarInstaller Before Optional  

Configuration

This installer has no configuration options.

Assembly selection is controlled via the InstallerContext:

(app, installer) =>
{
    installer.SetSoftwareAssembly();                  // required: scans entry assembly for controllers
    installer.AddAssembly(typeof(SomeController));    // optional: include controllers from other assemblies
}

InstallerContext Extension

installer.WithControllers(bool enabled = true);

Notes