BbQ.Outcome.AspNetCore
1.2.0-preview.2
dotnet add package BbQ.Outcome.AspNetCore --version 1.2.0-preview.2
NuGet\Install-Package BbQ.Outcome.AspNetCore -Version 1.2.0-preview.2
<PackageReference Include="BbQ.Outcome.AspNetCore" Version="1.2.0-preview.2" />
<PackageVersion Include="BbQ.Outcome.AspNetCore" Version="1.2.0-preview.2" />
<PackageReference Include="BbQ.Outcome.AspNetCore" />
paket add BbQ.Outcome.AspNetCore --version 1.2.0-preview.2
#r "nuget: BbQ.Outcome.AspNetCore, 1.2.0-preview.2"
#:package BbQ.Outcome.AspNetCore@1.2.0-preview.2
#addin nuget:?package=BbQ.Outcome.AspNetCore&version=1.2.0-preview.2&prerelease
#tool nuget:?package=BbQ.Outcome.AspNetCore&version=1.2.0-preview.2&prerelease
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 | Versions 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. |
-
net10.0
- BbQ.Outcome (>= 1.2.0-preview.2)
-
net8.0
- BbQ.Outcome (>= 1.2.0-preview.2)
-
net9.0
- BbQ.Outcome (>= 1.2.0-preview.2)
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 |