REslava.Result
1.54.0
Prefix Reserved
dotnet add package REslava.Result --version 1.54.0
NuGet\Install-Package REslava.Result -Version 1.54.0
<PackageReference Include="REslava.Result" Version="1.54.0" />
<PackageVersion Include="REslava.Result" Version="1.54.0" />
<PackageReference Include="REslava.Result" />
paket add REslava.Result --version 1.54.0
#r "nuget: REslava.Result, 1.54.0"
#:package REslava.Result@1.54.0
#addin nuget:?package=REslava.Result&version=1.54.0
#tool nuget:?package=REslava.Result&version=1.54.0
REslava.Result
Visual Result pipelines for .NET — typed errors, Railway-Oriented pipelines, automatic flow diagrams.
Don't try to understand the pipeline—watch the flow.


→ Full documentation and diagram gallery on GitHub
Why REslava.Result?
- Result<T> + OneOf (2–8 types) + Maybe<T> in a single zero-dependency package
- Use Result<TValue, TError> and ErrorsOf<T1..T8> — Typed Error Pipelines when you want compile-time-known, exhaustive failure edges
- Domain error hierarchy —
NotFoundError,ValidationError,ConflictError,UnauthorizedError,ForbiddenErrorwith HTTP status code tags - Implicit conversions — just
return user;orreturn new NotFoundError(); - LINQ query syntax — compose results with
from ... in ... select - Async patterns —
WhenAll(typed tuples),Retry(exponential backoff),Timeout - JSON serialization —
System.Text.Jsonconverters forResult<T>,OneOf,Maybe<T> - Native Validation DSL — 19 fluent extension methods (
NotEmpty,MaxLength,EmailAddress,Range,Positive, ...) onValidatorRuleBuilder<T>with auto-inferred field names - Pipeline visualization —
[ResultFlow]auto-generates Mermaid diagrams from your code (separate package); install REslava.Result Extensions from the VS Code Marketplace for▶ Open diagram previewCodeLens - Roslyn safety analyzers — catch unsafe
.Valueaccess at compile time (separate package) - ASP.NET integration — auto-generate Minimal API + MVC endpoints with domain error mapping (separate package)
No other .NET library combines all of these.
Before / After
// Before: Exception-based control flow
try {
var user = await GetUser(id);
var account = await GetAccount(user.AccountId);
return Ok(new Summary(user.Name, account.Balance));
}
catch (NotFoundException ex) { return NotFound(ex.Message); }
catch (ValidationException ex) { return BadRequest(ex.Message); }
// After: Railway-oriented with REslava.Result
var result = await GetUser(id)
.BindAsync(user => GetAccount(user.AccountId))
.MapAsync(account => new Summary(account.User.Name, account.Balance));
return result.Match(
onSuccess: summary => Results.Ok(summary),
onFailure: errors => Results.BadRequest(errors));
Pipeline Visualization — Choose Your Track
| Track A | Track B | |
|---|---|---|
| Use when | Using REslava.Result | Any other Result library (ErrorOr, LanguageExt, FluentResults, custom) |
| Install | REslava.Result + REslava.Result.Flow |
REslava.ResultFlow |
| Analysis | Full semantic — typed error edges, type travel, FAIL annotation, body scanning | Syntax-only — library-agnostic, convention file |
| Diagram constants | _Diagram · _TypeFlow · _LayerView · _Stats · _ErrorSurface · _ErrorPropagation |
_Diagram · _TypeFlow |
Track A (recommended with REslava.Result):
dotnet add package REslava.Result
dotnet add package REslava.Result.Flow
Track B (library-agnostic):
dotnet add package REslava.ResultFlow
VS Code extension (both tracks): Install REslava.Result Extensions for the Flow Catalog sidebar and ▶ Open diagram preview CodeLens.
Quick Start
dotnet add package REslava.Result
using REslava.Result;
// Create results
Result<User> success = new User("Alice", "alice@example.com"); // implicit conversion
Result<User> failure = new NotFoundError("User not found"); // implicit conversion
// Transform and compose
var result = await GetUser(id)
.Map(user => user.Email)
.Ensure(email => email.Contains("@"), "Invalid email")
.Bind(email => SendWelcomeEmail(email));
// Handle both cases
var message = result.Match(
onSuccess: value => $"Sent to {value}",
onFailure: errors => $"Failed: {errors.First().Message}");
Companion Packages
| Package | Description |
|---|---|
| REslava.Result.Flow | Visualises Result<T> pipelines with full type travel and typed error surface in generated Mermaid diagrams |
| REslava.Result.AspNetCore | Auto-generate ASP.NET endpoints (Minimal API + MVC), IResult/IActionResult conversions, OneOf extensions, OpenAPI metadata |
| REslava.Result.Http | Wrap HttpClient calls so every HTTP response and network failure becomes a typed Result<T> |
| REslava.Result.Analyzers | Roslyn analyzers that catch unsafe Result/OneOf usage at compile time |
| REslava.Result.OpenTelemetry | Zero-cost OpenTelemetry integration — seeds ResultContext from the active span and writes error tags as span attributes on failure |
| REslava.Result.Diagnostics | HTTP trace endpoint (GET /reslava/traces) that bridges RingBufferObserver to the VSIX Live panel — PipelineTraceHost.Start(buffer) or app.MapResultFlowTraces(buffer) |
| FluentValidation | ≥ 11.x (installed by user) ⚠️ Optional FluentValidation bridge |
Links
- GitHub Repository — Full documentation, architecture guide, samples
- Changelog
- API Samples
MIT License | .NET Framework 4.6.1+ / .NET Core 2.0+ / .NET 8 / 9 / 10
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Collections.Immutable (>= 8.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Text.Json (>= 8.0.5)
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on REslava.Result:
| Package | Downloads |
|---|---|
|
REslava.Result.Analyzers
Roslyn safety analyzers for REslava.Result. Enforces correct usage patterns at compile time — detects unsafe .Value access, missing IsSuccess checks, incorrect error type usage, and domain boundary violations. RESL10xx series covers API safety; RESL20xx series covers domain modeling rules. Zero runtime overhead — analysis runs entirely at compile time. |
|
|
REslava.Result.Http
HttpClient extensions that return Result<T> instead of throwing. Maps HTTP 4xx/5xx status codes to typed REslava.Result domain errors (NotFoundError, UnauthorizedError, ForbiddenError, ConflictError, ValidationError) and wraps network exceptions in ExceptionError. Designed for Railway-Oriented pipelines — chain BindAsync, Map, Ensure directly on HTTP responses. Configurable via HttpResultOptions. |
|
|
REslava.Result.AspNetCore
ASP.NET Core source generators for REslava.Result. SmartEndpoints auto-generates complete Minimal API and MVC endpoints from business logic methods — routing, DI injection, HTTP status mapping, full OpenAPI metadata (Produces<T>, WithSummary, WithTags), and authorization support. Also generates ToIResult() and ToOneOfResult() extension methods for manual endpoint mapping. |
|
|
REslava.Result.Flow
REslava.Result-native source generator for automatic Mermaid pipeline diagrams. Add [ResultFlow] to any pipeline method — produces a typed flow diagram with success type travel at every step, named error edges from method body scanning, and entry-point detection via full Roslyn semantic analysis. Requires REslava.Result. For library-agnostic visualization, see REslava.ResultFlow. |
|
|
REslava.Result.OpenTelemetry
OpenTelemetry integration for REslava.Result. Seeds ResultContext.CorrelationId from the active span's TraceId and OperationName from its DisplayName via .WithOpenTelemetry(). Writes error tags as span attributes on pipeline failure via .WriteErrorTagsToSpan(). Zero cost when no active span is present — checks Activity.Current == null before any allocation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.54.0 | 303 | 4/6/2026 |
| 1.53.0 | 292 | 4/5/2026 |
| 1.52.0 | 282 | 3/30/2026 |
| 1.51.0 | 286 | 3/28/2026 |
| 1.50.1 | 131 | 3/25/2026 |
| 1.50.0 | 136 | 3/25/2026 |
| 1.49.0 | 142 | 3/24/2026 |
| 1.48.0 | 138 | 3/22/2026 |
| 1.47.5 | 140 | 3/22/2026 |
| 1.47.4 | 132 | 3/21/2026 |
| 1.47.3 | 131 | 3/20/2026 |
| 1.47.2 | 139 | 3/20/2026 |
| 1.47.1 | 129 | 3/18/2026 |
| 1.47.0 | 130 | 3/18/2026 |
| 1.46.3 | 133 | 3/18/2026 |
| 1.46.2 | 137 | 3/18/2026 |
| 1.46.1 | 134 | 3/17/2026 |
| 1.46.0 | 141 | 3/17/2026 |
| 1.45.0 | 138 | 3/17/2026 |
| 1.44.1 | 164 | 3/16/2026 |