LowCodeHub.MinimalEndpoints
0.0.1
See the version list below for details.
dotnet add package LowCodeHub.MinimalEndpoints --version 0.0.1
NuGet\Install-Package LowCodeHub.MinimalEndpoints -Version 0.0.1
<PackageReference Include="LowCodeHub.MinimalEndpoints" Version="0.0.1" />
<PackageVersion Include="LowCodeHub.MinimalEndpoints" Version="0.0.1" />
<PackageReference Include="LowCodeHub.MinimalEndpoints" />
paket add LowCodeHub.MinimalEndpoints --version 0.0.1
#r "nuget: LowCodeHub.MinimalEndpoints, 0.0.1"
#:package LowCodeHub.MinimalEndpoints@0.0.1
#addin nuget:?package=LowCodeHub.MinimalEndpoints&version=0.0.1
#tool nuget:?package=LowCodeHub.MinimalEndpoints&version=0.0.1
LowCodeHub.MinimalEndpoints
LowCodeHub.MinimalEndpoints is a utility library for ASP.NET Core Minimal APIs that gives you:
- modular endpoint registration
- endpoint logging and validation filters
- language and timezone awareness middleware
- JSON-based localization (
IStringLocalizer) - lightweight event bus (in-memory or Redis-backed)
- mapping and result helpers
Installation
dotnet add package LowCodeHub.MinimalEndpoints
Features
1) Modular endpoint mapping
Define modules implementing IModule and map them automatically.
app.MapModules<Program>();
// or:
app.MapModules(typeof(Program).Assembly);
2) Endpoint filters
AddLogging<TEndpoint>()for request timing/loggingAddValidator<TRequest>()for sync/async request validation
app.MapPost("/orders", (CreateOrderRequest req) => Results.Ok())
.AddValidator<CreateOrderRequest>();
3) Language awareness
Reads language from headers (Language, Accept-Language, X-Culture) and sets request language context.
builder.Services.AddLanguageAwareness(defaultLanguage: "en");
app.UseLanguageAwareness();
4) Timezone awareness
Reads timezone from configured headers and stores it in request context.
builder.Services.AddTimeZoneAwareness("TimeZone", "X-TimeZone");
app.UseTimeZoneAwareness();
5) JSON localization
Uses JSON resource files through native IStringLocalizer.
builder.Services.AddJsonLocalization(options =>
{
options.ResourcesPath = "Resources";
});
app.UseJsonLocalization("en", "ar");
Example resource files:
Resources/en.jsonResources/ar.json
Supports nested keys with dot notation:
{
"Errors": {
"USER_NOT_FOUND": "User not found"
}
}
Access key: Errors.USER_NOT_FOUND
6) Event bus (in-memory)
builder.Services.AddEventBus<Program>();
- bounded channel for backpressure
- hosted background processor
- handler auto-registration from scanned assemblies
7) Event bus (Redis-backed)
builder.Services.AddRedisEventBus(options =>
{
options.ConnectionString = "localhost:6379";
options.QueueKey = "domain-events";
options.ProcessingQueueKey = "domain-events:processing";
options.PopTimeoutSeconds = 5;
}, typeof(Program).Assembly);
Redis mode includes:
- reliable processing queue (
BRPOPLPUSH) - ack on success
- nack + requeue on failure
Domain events
public record OrderCreated(Guid OrderId) : IDomainEvent;
public sealed class OrderCreatedHandler : IDomainEventHandler<OrderCreated>
{
public ValueTask Handle(OrderCreated domainEvent, CancellationToken cancellationToken)
{
// handle event
return ValueTask.CompletedTask;
}
}
Publish event:
await eventBus.Publish(new OrderCreated(orderId), cancellationToken);
Best practices
- Use
MapModulesto keep endpoint registration organized by feature. - Add
AddValidator<TRequest>()to write-side endpoints. - Prefer Redis event bus for multi-instance deployments.
- Keep event handlers idempotent.
- Use short, stable event contract names and avoid breaking schema changes.
- Keep localization JSON keys stable across languages.
Notes
- Request language/timezone contexts are cleaned after each request.
- Redis event bus requires
StackExchange.Redisconnectivity. - If no event handlers are registered for an event, processing still completes safely.
| 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
- ErrorOr (>= 2.0.1)
- StackExchange.Redis (>= 2.11.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LowCodeHub.MinimalEndpoints:
| Package | Downloads |
|---|---|
|
LowCodeHub.MinimalEndpoints.Mcp
Model Context Protocol integration for LowCodeHub.MinimalEndpoints, exposing opt-in API contracts as MCP tools over ASP.NET Core Streamable HTTP. |
GitHub repositories
This package is not used by any popular GitHub repositories.