KamiSama.Modules
10.0.11.4
dotnet add package KamiSama.Modules --version 10.0.11.4
NuGet\Install-Package KamiSama.Modules -Version 10.0.11.4
<PackageReference Include="KamiSama.Modules" Version="10.0.11.4" />
<PackageVersion Include="KamiSama.Modules" Version="10.0.11.4" />
<PackageReference Include="KamiSama.Modules" />
paket add KamiSama.Modules --version 10.0.11.4
#r "nuget: KamiSama.Modules, 10.0.11.4"
#:package KamiSama.Modules@10.0.11.4
#addin nuget:?package=KamiSama.Modules&version=10.0.11.4
#tool nuget:?package=KamiSama.Modules&version=10.0.11.4
KamiSama.Modules
Version: 10.0.0
Description
Composable ASP.NET Core modules that register services before application build and apply middleware or endpoints afterward. Use this package to assemble startup behavior in explicit module order through ExtendedWebApplicationBuilder.
How to use
dotnet add package KamiSama.Modules --version 10.0.0
Wrap a standard builder, add modules in the required middleware and endpoint order, and finish with BuildAsync. All module service phases run first in insertion order, the application is built once, and then all application phases run in the same order:
using KamiSama.Modules;
var webBuilder = WebApplication.CreateBuilder(args);
webBuilder.Services.AddAntiforgery(); // Required before AddAntiForgery.
var builder = webBuilder.Extend()
.AddForwardedHeaders()
.AddHttpsRedirection()
.AddStaticFiles()
.AddRouting(options => options.LowercaseUrls = true)
.AddAuthorization()
.AddAntiForgery()
.AddControllers()
.AddSwagger();
var app = await builder.BuildAsync(CancellationToken.None);
await app.RunAsync();
Module order is middleware and endpoint order during the post-build phase. A failure stops later modules, and a cancellation token is only passed to modules; most built-in modules ignore it. Build blocks on BuildAsync(CancellationToken.None).Result. AntiForgeryModule only calls UseAntiforgery, so register antiforgery services separately. Do not add ResponseCachingModule in a runnable build: its application phase always throws NotImplementedException, causing both build methods to fail after the underlying application has already been built.
Namespaces
- KamiSama.Modules (37 types)
Types
- KamiSama.Modules.AntiForgeryExtension - Provides fluent registration of
AntiForgeryModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.AntiForgeryModule - Adds antiforgery middleware after build but does not register the required antiforgery services. Register them separately before adding this module.
- KamiSama.Modules.AuthorizationExtension - Provides fluent registration of
AuthorizationModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.AuthorizationModule - Registers authorization services before build and adds authorization middleware afterward. Its position in module order determines middleware order.
- KamiSama.Modules.CascadingAuthenticationExtension - Provides fluent registration of
CascadingAuthenticationModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.CascadingAuthenticationModule - Registers Blazor cascading authentication-state services before build. It performs no post-build application configuration.
- KamiSama.Modules.ControllersModule - Registers MVC controllers, supports MVC-builder customization, and maps controller endpoints after build. Use the callback or a derived override to customize registration.
- KamiSama.Modules.ControllersModuleExtension - Provides fluent registration of
ControllersModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.CorsExtension - Provides fluent registration of
CorsModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.CorsModule - Registers CORS options and adds inline-policy CORS middleware. Service options and middleware policy use separate callbacks.
- KamiSama.Modules.CustomActionExtension - Provides fluent synchronous and asynchronous custom post-build actions. Use it with the surrounding package APIs when composing application code.
- KamiSama.Modules.CustomActionModule - Conditionally awaits a caller-provided application action during post-build configuration. It ignores the build cancellation token and registers no services.
- KamiSama.Modules.ExtendedWebApplicationBuilder - Composable wrapper around
WebApplicationBuilderthat collects web modules and applies them in a predictable build flow. - KamiSama.Modules.ForwardedHeadersExtension - Provides fluent registration of
ForwardedHeadersModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.ForwardedHeadersModule - Constructs forwarded-header options after build and adds the middleware. It does not register services during the first module phase.
- KamiSama.Modules.HstsExtension - Provides fluent registration of
HstsModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.HstsModule - Adds HSTS middleware after build with framework-configured options. It performs no service registration.
- KamiSama.Modules.HttpsRedirectionExtension - Provides fluent registration of
HttpsRedirectionModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.HttpsRedirectionModule - Adds HTTPS redirection middleware after build with framework-configured options. It performs no service registration.
- KamiSama.Modules.RazorComponentExtension - Provides fluent registration and mapping of a root Razor component. Use it with the surrounding package APIs when composing application code.
- KamiSama.Modules.RazorComponentModule<TRootComponent> - Registers Razor component services and maps the selected root component after build. The endpoint callback can add conventions to the mapped component.
- KamiSama.Modules.RazorPagesModule - Registers configured Razor Pages services and maps page endpoints after build. Its endpoint mapping follows module insertion order.
- KamiSama.Modules.RazorPagesModuleExtension - Provides fluent registration of
RazorPagesModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.RequestLocalizationExtension - Provides fluent request-localization module registration. Use it with the surrounding package APIs when composing application code.
- KamiSama.Modules.RequestLocalizationModule - Registers localization and request-localization options before build, then adds request-localization middleware. The required callback defines provider and supported-culture behavior.
- KamiSama.Modules.ResponseCachingExtension - Provides fluent registration of the currently incomplete
ResponseCachingModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.ResponseCachingModule - Registers response-caching services but always throws
NotImplementedExceptionduring post-build configuration. Adding it causes both extended build methods to fail. - KamiSama.Modules.ResponseCompressionExtension - Provides fluent registration of
ResponseCompressionModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.ResponseCompressionModule - Registers configured response-compression services and adds compression middleware after build. Middleware position follows module insertion order.
- KamiSama.Modules.RoutingExtension - Provides fluent registration of
RoutingModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.RoutingModule - Registers route options and explicitly adds routing middleware after build. Add endpoint-producing modules in an order consistent with the intended pipeline.
- KamiSama.Modules.StaticFileExtension - Provides fluent registration of
StaticFilesModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.StaticFilesModule - Maps ASP.NET Core static assets after build through
MapStaticAssets. It does not add conventional static-file middleware. - KamiSama.Modules.SwaggerModule - Registers Swagger generation and exposes Swagger document and UI middleware in Development or when production exposure is enabled. Generation and UI use separate callbacks.
- KamiSama.Modules.SwaggerModuleExtension - Provides fluent registration of
SwaggerModule. Use it with the surrounding package APIs when composing application code. - KamiSama.Modules.WebApplicationBuilderExtension - Wraps a standard
WebApplicationBuilderin anExtendedWebApplicationBuilder. Wrapping alone does not register services or build the application. - KamiSama.Modules.WebModule - Base abstraction for modular ASP.NET Core setup. Implement it when a feature area needs to register services before build and apply middleware or endpoints after build.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Swashbuckle.AspNetCore (>= 10.2.3)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on KamiSama.Modules:
| Package | Downloads |
|---|---|
|
Polareum.Api
Package Description |
|
|
KamiSama.Modules.Identity.Core
ASP.NET Core Identity implementation for KamiSama login, token refresh, logout, user, role, password, two-factor, and session feature contracts, with revocable JWT sessions, EF Core persistence, mappings, and modular startup registration. Install it with exactly one Identity database provider and review the documented security and runtime limitations before exposing its features. |
|
|
KamiSama.Modules.Locations.Core
ASP.NET Core Locations implementation with EF Core province and city persistence, scoped feature services, modular registration, and startup database initialization. |
|
|
KamiSama.Modules.Ticketing.Core
ASP.NET Core Ticketing implementation with EF Core entities, validated ticket workflows, repositories, scoped features, modular registration, and startup database initialization. |
|
|
KamiSama.ExternalServices.Email.Core
Provider-selecting email registration for ASP.NET Core applications, including default-provider options and a built-in mock provider. Use it to route ISendEmail calls to keyed transport implementations. |
GitHub repositories
This package is not used by any popular GitHub repositories.