BbQ.Outcome
1.0.2
See the version list below for details.
dotnet add package BbQ.Outcome --version 1.0.2
NuGet\Install-Package BbQ.Outcome -Version 1.0.2
<PackageReference Include="BbQ.Outcome" Version="1.0.2" />
<PackageVersion Include="BbQ.Outcome" Version="1.0.2" />
<PackageReference Include="BbQ.Outcome" />
paket add BbQ.Outcome --version 1.0.2
#r "nuget: BbQ.Outcome, 1.0.2"
#:package BbQ.Outcome@1.0.2
#addin nuget:?package=BbQ.Outcome&version=1.0.2
#tool nuget:?package=BbQ.Outcome&version=1.0.2
Outcome
Outcome is a modern C# functional result type inspired by ErrorOr.
It builds on the excellent foundation of ErrorOr by adding async workflows, LINQ query syntax, deconstruction, Source Link, and multi-targeting — making error-aware programming feel like a first-class citizen in modern .NET.
✨ Why Outcome?
ErrorOr pioneered the idea of replacing exceptions with a discriminated union of either a value or errors.
Outcome takes this idea further:
- Structured errors: Rich
Errorrecord withCode,Description, andSeverity. - Async composition:
BindAsync,MapAsync,CombineAsyncfor natural async pipelines. - LINQ integration: Native
Select/SelectManysupport for sync + async queries. - Deconstruction: Tuple-style unpacking
(isSuccess, value, errors)for ergonomic handling. - Friendly ToString: Human-readable logging like
Success: 42orErrors: [DIV_ZERO: Division by zero]. - Multi-targeting: Works across
netstandard2.0,net6.0, andnet8.0. - Source Link enabled: Step directly into source when debugging NuGet packages.
- Source generator support: Auto-generate
Error<T>helper properties from enums with the[QbqOutcome]attribute.
🚀 Example
var query =
from x in ParseAsync("10")
from y in DivideAsync(x, 2)
select y * 2;
var (ok, value, errors) = await query;
Console.WriteLine(ok
? $"Result: {value}"
: $"Errors: {string.Join("; ", errors.Select(e => e.Description))}");
Output:
Result: 10
📦 Installation
dotnet add package BbQ.Outcome
🔧 Source Generator: Error Helper Properties
The [QbqOutcome] attribute enables automatic generation of Error<TCode> helper properties for enums. This eliminates boilerplate and keeps error definitions DRY.
Usage
Mark your error enum with [QbqOutcome]:
[QbqOutcome]
public enum ApiErrorCode
{
/// <summary>
/// The requested resource was not found.
/// </summary>
NotFound,
/// <summary>
/// The user does not have permission to access this resource.
/// </summary>
Unauthorized,
/// <summary>
/// An internal server error occurred.
/// </summary>
InternalError
}
The source generator automatically creates a static class ApiErrorCodeErrors with helper properties:
// Generated code (do not edit)
public static class ApiErrorCodeErrors
{
public static Error<ApiErrorCode> NotFoundError =>
new(
ApiErrorCode.NotFound,
"The requested resource was not found.",
ErrorSeverity.Error
);
public static Error<ApiErrorCode> UnauthorizedError =>
new(
ApiErrorCode.Unauthorized,
"The user does not have permission to access this resource.",
ErrorSeverity.Error
);
public static Error<ApiErrorCode> InternalErrorError =>
new(
ApiErrorCode.InternalError,
"An internal server error occurred.",
ErrorSeverity.Error
);
}
Benefits
- Zero boilerplate: No manual
Error<TCode>construction. - Documentation-driven: Descriptions are extracted from XML doc comments (
<summary>tags). - Consistent naming: Property names follow the pattern
{EnumMember}Error. - Type-safe: Full compile-time type checking with
Error<YourEnumType>.
How It Works
- The generator scans for enums decorated with
[QbqOutcome]. - For each enum member, it extracts the summary from XML documentation comments.
- It generates a static helper class with pre-constructed
Error<T>properties. - If no documentation is found, it falls back to the enum member name.
| 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 was computed. 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 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BbQ.Outcome:
| Package | Downloads |
|---|---|
|
BbQ.ChatWidgets
Framework-agnostic widgets for AI chat UIs, powered by Microsoft.Extensions.AI. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.1 | 112 | 4/17/2026 |
| 1.1.0 | 107 | 4/16/2026 |
| 1.0.17 | 117 | 4/3/2026 |
| 1.0.16 | 274 | 3/12/2026 |
| 1.0.15 | 97 | 3/11/2026 |
| 1.0.14 | 94 | 3/6/2026 |
| 1.0.13 | 93 | 3/4/2026 |
| 1.0.12 | 114 | 1/27/2026 |
| 1.0.11 | 107 | 1/26/2026 |
| 1.0.10 | 770 | 11/28/2025 |
| 1.0.9 | 163 | 11/28/2025 |
| 1.0.8 | 198 | 11/27/2025 |
| 1.0.7 | 203 | 11/27/2025 |
| 1.0.6 | 200 | 11/26/2025 |
| 1.0.5 | 207 | 11/26/2025 |
| 1.0.4 | 203 | 11/26/2025 |
| 1.0.3 | 197 | 11/25/2025 |
| 1.0.2 | 204 | 11/23/2025 |
| 1.0.1 | 205 | 11/23/2025 |
| 1.0.0 | 210 | 11/23/2025 |