AuroraScienceHub.Framework.AspNetCore
11.4.0
Prefix Reserved
dotnet add package AuroraScienceHub.Framework.AspNetCore --version 11.4.0
NuGet\Install-Package AuroraScienceHub.Framework.AspNetCore -Version 11.4.0
<PackageReference Include="AuroraScienceHub.Framework.AspNetCore" Version="11.4.0" />
<PackageVersion Include="AuroraScienceHub.Framework.AspNetCore" Version="11.4.0" />
<PackageReference Include="AuroraScienceHub.Framework.AspNetCore" />
paket add AuroraScienceHub.Framework.AspNetCore --version 11.4.0
#r "nuget: AuroraScienceHub.Framework.AspNetCore, 11.4.0"
#:package AuroraScienceHub.Framework.AspNetCore@11.4.0
#addin nuget:?package=AuroraScienceHub.Framework.AspNetCore&version=11.4.0
#tool nuget:?package=AuroraScienceHub.Framework.AspNetCore&version=11.4.0
AuroraScienceHub.Framework.AspNetCore
ASP.NET Core extensions including web application module composition, problem details handling, and security utilities.
Overview
Extends the Composition framework with ASP.NET Core-specific functionality, providing web application modules and standardized error handling.
Key Features
- Web Application Modules - Extend composition framework for web apps
- Problem Details - RFC 7807 compliant error responses
- Security Utilities - Authentication and authorization helpers
- Routing Extensions - Simplified endpoint configuration
- Output Caching - Opt-in caching for authenticated machine-to-machine endpoints
Installation
dotnet add package AuroraScienceHub.Framework.AspNetCore
Usage
Web Application Module
public class UserWebModule : WebApplicationModuleBase<UserModuleOptions>
{
public UserWebModule()
: base("User", new ServiceModuleBase[]
{
new UserServiceModule()
})
{
}
public override void ConfigureApplication(
IApplicationBuilder app,
IConfiguration configuration)
{
// Configure middleware pipeline
app.UseAuthentication();
app.UseAuthorization();
}
}
// Register in Program.cs
var builder = WebApplication.CreateBuilder(args);
var userModule = new UserWebModule();
userModule.ConfigureServices(builder.Services, builder.Configuration);
var app = builder.Build();
userModule.ConfigureApplication(app, app.Configuration);
Problem Details Error Handling
app.UseExceptionHandler(exceptionHandlerApp =>
{
exceptionHandlerApp.Run(async context =>
{
var exception = context.Features.Get<IExceptionHandlerFeature>()?.Error;
var problemDetails = exception switch
{
ValidationException ex => new ProblemDetails
{
Status = 400,
Title = "Validation Error",
Detail = ex.Message
},
EntityNotFoundException ex => new ProblemDetails
{
Status = 404,
Title = "Not Found",
Detail = ex.Message
},
_ => new ProblemDetails
{
Status = 500,
Title = "An error occurred"
}
};
await context.Response.WriteAsJsonAsync(problemDetails);
});
});
Module Options
public class UserModuleOptions : ApplicationModuleOptionsBase
{
public bool EnableEmailVerification { get; set; } = true;
}
// appsettings.json
{
"Modules": {
"User": {
"EnableEmailVerification": true,
"EnableConsumers": true
}
}
}
Output Caching for Authenticated Endpoints
ASP.NET Core's default output cache policy refuses to cache any request that carries an
Authorization header. For machine-to-machine endpoints whose response is the same for every
caller, opt in explicitly:
builder.Services.AddOutputCache();
app.MapGet("/api/forecast", GetForecast)
.CacheOutput(policy => policy
.AllowAuthenticated()
.Expire(TimeSpan.FromSeconds(30)));
Use it only when the response does not depend on the caller: the policy re-enables lookup and storage for an authenticated GET or HEAD, and the endpoint stays behind authentication and authorization.
License
See LICENSE file in the repository root.
Related Packages
AuroraScienceHub.Framework.Composition- Core module compositionAuroraScienceHub.Framework.Diagnostics- Health checks
| 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. net11.0 is compatible. |
-
net10.0
- App.Metrics.Abstractions (>= 4.3.0)
- AspNetCore.HealthChecks.NpgSql (>= 9.0.0)
- AspNetCore.HealthChecks.Sqlite (>= 9.0.0)
- AuroraScienceHub.Framework.Composition (>= 11.4.0)
- AuroraScienceHub.Framework.Diagnostics (>= 11.4.0)
- AuroraScienceHub.Framework.Entities (>= 11.4.0)
- AuroraScienceHub.Framework.Utilities (>= 11.4.0)
- Mediator.Abstractions (>= 3.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 11.0.0)
- Npgsql (>= 10.0.2)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12)
-
net11.0
- App.Metrics.Abstractions (>= 4.3.0)
- AspNetCore.HealthChecks.NpgSql (>= 9.0.0)
- AspNetCore.HealthChecks.Sqlite (>= 9.0.0)
- AuroraScienceHub.Framework.Composition (>= 11.4.0)
- AuroraScienceHub.Framework.Diagnostics (>= 11.4.0)
- AuroraScienceHub.Framework.Entities (>= 11.4.0)
- AuroraScienceHub.Framework.Utilities (>= 11.4.0)
- Mediator.Abstractions (>= 3.0.2)
- Npgsql (>= 10.0.2)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.4.0 | 103 | 11/19/2026 |
| 11.3.0 | 104 | 11/14/2026 |
| 11.2.0 | 79 | 11/13/2026 |
| 11.1.1 | 80 | 11/8/2026 |
| 11.1.0 | 70 | 11/5/2026 |
| 11.0.1 | 101 | 10/19/2026 |
| 11.0.0 | 84 | 10/16/2026 |
| 10.1.0 | 201 | 8/19/2026 |
| 10.0.8 | 154 | 8/14/2026 |
| 10.0.7 | 142 | 8/11/2026 |
| 10.0.6 | 132 | 8/11/2026 |
| 10.0.5 | 159 | 4/23/2026 |
| 10.0.4 | 152 | 4/23/2026 |
| 10.0.3 | 165 | 2/11/2026 |
| 10.0.2 | 151 | 1/29/2026 |
| 10.0.1 | 265 | 12/25/2025 |
| 10.0.0 | 472 | 12/11/2025 |
| 9.0.7 | 462 | 11/20/2025 |
| 9.0.6 | 228 | 11/15/2025 |