BbQ.Outcome.AspNetCore 1.2.0-preview.2

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

BbQ.Outcome.AspNetCore

Optional HTTP adapter for .NET 8, 9, and 10. The core Outcome package remains free of ASP.NET dependencies.

Installation

This package ships with the Outcome family under the same outcome-v* version.

dotnet add package BbQ.Outcome.AspNetCore --prerelease
using BbQ.Outcome.AspNetCore;

services.AddSingleton<IErrorDescriptorProvider<AppError>>(applicationErrorDescriptors);
services.AddOutcomeHttpMapping<AppError>(options =>
{
    options.Rules["USER_MISSING"] = new(404, ExposeDescription: true);
    options.Rules["EMAIL_CONFLICT"] = new(409, ExposeDescription: true);
    options.Rules["INVALID_EMAIL"] = new(400, ExposeDescription: true, ExposeTarget: true);
});

// Inside an endpoint; mapper comes from DI.
return outcome.ToIResult(mapper, user => TypedResults.Created($"/users/{user.Id}", user));

The default success result is 200 OK; a success callback can choose 201 Created, 204 No Content, or any endpoint-specific result. Failures use TypedResults.Problem(ProblemDetails), so the existing ASP.NET Core Problem Details service and its customization hooks remain in charge of response writing. Register AddProblemDetails(options => ...) for application-wide customization.

Error mapping and exposure

IOutcomeHttpMapper<TError> can be replaced entirely. The supplied OutcomeHttpMapper<TError> obtains transport-neutral descriptors and applies an explicit code-to-status policy. Severity does not determine HTTP status. Unknown codes become a generic 500 with UNEXPECTED_ERROR; their original codes, descriptions, fields, and metadata are not exposed.

Known codes are exposed, but their descriptions, targets, and metadata remain hidden by default. Enable description/target exposure on an individual HttpErrorRule. Metadata requires both that rule's ExposeMetadata flag and an entry in AllowedMetadataKeys. Allowlisting a key approves its entire value, so avoid complex values containing secrets. Stack traces, exception objects, and attempted values are never copied automatically.

A failure has an errors extension containing redacted PublicOutcomeError entries in input order. When all mapped statuses agree, that status is used. Mixed statuses become 500 if any is a server error; otherwise 400. Override SelectStatus for a different mixed-error policy. All configured and selected failure statuses must be 400–599.

Configuration dictionaries are snapshotted. Delegates are application-owned and should be thread-safe. Mapper services are scoped to allow request-scoped localization providers. Invalid/default outcomes are rejected through the core's guarded getters rather than serialized accidentally.

ToIResultAsync cancels waiting for an existing task but cannot cancel its producer; pass the request token to the producer too. This package is a boundary adapter, not a JSON wire format for Outcome itself.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
1.2.0-preview.2 36 9/13/2026
1.2.0-preview.1 32 9/13/2026