AxisResult.HttpResponse 2.2.0

dotnet add package AxisResult.HttpResponse --version 2.2.0
                    
NuGet\Install-Package AxisResult.HttpResponse -Version 2.2.0
                    
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="AxisResult.HttpResponse" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AxisResult.HttpResponse" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="AxisResult.HttpResponse" />
                    
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 AxisResult.HttpResponse --version 2.2.0
                    
#r "nuget: AxisResult.HttpResponse, 2.2.0"
                    
#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 AxisResult.HttpResponse@2.2.0
                    
#: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=AxisResult.HttpResponse&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=AxisResult.HttpResponse&version=2.2.0
                    
Install as a Cake Tool

AxisResult.HttpResponse — Documentation

🌐 Português (documentação navegável)

The HTTP edge for AxisResult — one extension member on HttpContext turns an AxisResult / AxisResult<T> into an ASP.NET Core IActionResult, mapping every AxisErrorType to the right status code and rendering failures as RFC 7807 ProblemDetails (with the request traceId and internal errors suppressed).

// In a controller — one line maps success and every failure category
[HttpPost]
public Task<IActionResult> Create(CreatePersonCommand cmd)
    => HttpContext.SendAsync(
        mediator.Cqrs.ExecuteAsync<CreatePersonCommand, CreatePersonResponse>(cmd),
        HttpStatusCode.Created);

Use this page as a map: read the trunk below (~5 min) and jump straight to the detail you need.


The trunk (read first)

From AxisResult to HTTP in 60 seconds

Your handlers return an AxisResult / AxisResult<T>. The controller's only job is to render it. This package is that renderer:

AxisResult ──success──▶ StatusCodeResult (200, or your status)
                                         │
AxisResult<T> ─success─▶ ObjectResult { Value, status }  (204 → NoContentResult)
                                         │
either ───────failure──▶ ObjectResult { ProblemDetails }  (status from the error)

A single call, HttpContext.SendAsync, awaits your handler's task and collapses both rails into the correct HTTP response. → Convert · HttpContext.SendAsync

Success vs. failure

  • Success, no value (AxisResult) → StatusCodeResult with statusCode (default 200 OK).
  • Success, with value (AxisResult<T>) → ObjectResult carrying Value; HttpStatusCode.NoContent yields a bodyless 204.
  • Failure → an ObjectResult wrapping a ProblemDetails, whose status is chosen from the most severe error in the list.

Error → status, the short version

Each AxisErrorType maps to a status code; on a multi-error failure the highest-severity error wins, InternalServerError is never leaked into the payload, and the traceId always travels in extensions. → Error → status mapping

Installation

dotnet add package AxisResult.HttpResponse

Depends on AxisResult and targets ASP.NET Core (FrameworkReference Microsoft.AspNetCore.App) — add it to a web project. → Full guide: Getting started


The map (jump to what you need)

Group You want to… Detail
Convert · HttpContext.SendAsync ⭐ turn an AxisResult into an IActionResult send-http-response.md
Reuse outside MVC · AxisProblemDetailsBuilder render the same ProblemDetails rule from middleware/filters, with no IActionResult problem-details-builder.md
Mapping · AxisErrorType → status know which error becomes which status code error-status-mapping.md
Why? the case for a dedicated edge package why-axisresult-httpresponse.md
Reference every extension at a glance api-reference.md

Start here: Getting started · Convert · HttpContext.SendAsync · Why AxisResult.HttpResponse?

Fundamentals: Error → status mapping · ProblemDetails shape

Reference & extras: API reference


Design principles

  1. One line at the controller. Success and every failure category collapse into a single HttpContext.SendAsync call — no try/catch, no branch you can forget.
  2. The error type chooses the status. Status codes are derived from AxisErrorType, not hand-written per endpoint, so the mapping is consistent across the whole API.
  3. Most-severe wins. A failure with many errors returns the status of the gravest one — a ValidationRule next to an InternalServerError is a 500, not a 400.
  4. Never leak internals. InternalServerError entries are counted but stripped from the payload; clients see that something failed, not what.
  5. Always traceable. The request traceId is taken from HttpContext.TraceIdentifier automatically — never passed by hand — and always rides along in ProblemDetails.Extensions, so a client report ties straight back to your logs.

License

Apache 2.0

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

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
2.2.0 312 7/21/2026
2.1.1 130 7/17/2026
2.1.0 127 7/17/2026
2.0.1 136 7/15/2026
2.0.0 147 7/15/2026