Fluens.Web 0.5.5

dotnet add package Fluens.Web --version 0.5.5
                    
NuGet\Install-Package Fluens.Web -Version 0.5.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fluens.Web" Version="0.5.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fluens.Web" Version="0.5.5" />
                    
Directory.Packages.props
<PackageReference Include="Fluens.Web" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Fluens.Web --version 0.5.5
                    
#r "nuget: Fluens.Web, 0.5.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Fluens.Web@0.5.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Fluens.Web&version=0.5.5
                    
Install as a Cake Addin
#tool nuget:?package=Fluens.Web&version=0.5.5
                    
Install as a Cake Tool

Fluens.Web

ASP.NET Core base types for Fluens web libraries: Result-to-HTTP mapping, global exception handler, and paged responses.

Installation

dotnet add package Fluens.Web

Usage

fluensBuilder.AddWeb();

// In middleware pipeline
app.UseExceptionHandler(); // GlobalExceptionHandler returns ProblemDetails

ResultExtensions map Result / Result<T> to HTTP responses:

app.MapPost("/orders", async (CreateOrder cmd, ICommandDispatcher dispatcher, CancellationToken ct) =>
{
    var result = await dispatcher.SendAsync(cmd, ct);
    return result.ToHttpResult(); // 204 on success, 4xx/5xx on failure
});

Error mapping: NotFoundError → 404, ValidationError → 400, ConflictError → 409, ForbiddenError → 403, unknown Error → 500.

Server-Side Localization

Pass an optional IStringLocalizer to translate error messages server-side. The Error.Message is used as the localization key and {Key} placeholders are replaced with MessageArgs values:

app.MapPost("/orders", async (
    CreateOrder cmd,
    ICommandDispatcher dispatcher,
    IStringLocalizer<OrderErrors> localizer,
    CancellationToken ct) =>
{
    var result = await dispatcher.SendAsync(cmd, ct);
    return result.ToHttpResult(localizer); // Translates error messages using localizer
});

When no localizer is provided (default), Error.Message is returned as-is — maintaining full backward compatibility. MessageArgs is always included in ProblemDetails.Extensions["messageArgs"] regardless of whether a localizer is used.

TranslatableMessageExtensions

Translate TranslatableMessage instances (from Fluens.Kernel.Translations) using ASP.NET Core IStringLocalizer:

var message = new TranslatableMessage("order.status.changed")
    .WithArg("orderId", "ORD-123")
    .WithArg("newStatus", "Shipped");

// Translate using IStringLocalizer — Code is the localization key,
// {Key} placeholders are replaced with Args values
string translated = message.Translate(localizer);

License

This project is licensed under the MIT License.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on Fluens.Web:

Package Downloads
Fluens.Web.Auth

JWT Bearer authentication and security headers middleware for Fluens web applications.

Fluens.Web.Observability

ASP.NET Core observability features: Prometheus metrics endpoint and request logging middleware.

Fluens.Web.Contexts

CorrelationId propagation, context accessors, and consumed message context for ASP.NET Core applications.

Fluens.Web.Validation

FluentValidation integration for ASP.NET Core minimal API endpoints with automatic request validation.

Fluens.Web.Cors

CORS configuration and middleware setup for Fluens web applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.5 32 2/28/2026
0.5.4 31 2/28/2026
0.5.3 50 2/27/2026
0.5.2 43 2/27/2026
0.5.1 49 2/27/2026
0.5.0 57 2/26/2026
0.3.2 54 2/26/2026
0.3.1 54 2/26/2026
0.3.0 63 2/24/2026
0.2.5 59 2/24/2026
0.2.4 56 2/24/2026
0.2.3 56 2/24/2026
0.1.0 63 2/23/2026