REslava.ResultFlow
1.47.1
Prefix Reserved
See the version list below for details.
dotnet add package REslava.ResultFlow --version 1.47.1
NuGet\Install-Package REslava.ResultFlow -Version 1.47.1
<PackageReference Include="REslava.ResultFlow" Version="1.47.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="REslava.ResultFlow" Version="1.47.1" />
<PackageReference Include="REslava.ResultFlow"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add REslava.ResultFlow --version 1.47.1
#r "nuget: REslava.ResultFlow, 1.47.1"
#:package REslava.ResultFlow@1.47.1
#addin nuget:?package=REslava.ResultFlow&version=1.47.1
#tool nuget:?package=REslava.ResultFlow&version=1.47.1
REslava.ResultFlow
Library-agnostic source generator for automatic Mermaid pipeline diagrams — works with any fluent Result library.
Add [ResultFlow] to any fluent method → the diagram is injected as a comment by the IDE code action (no build needed), or accessed as a const string after build. Zero runtime overhead. Zero manual maintenance.
Ships with a built-in convention dictionary pre-configured for REslava.Result, ErrorOr, LanguageExt, and FluentResults. Any other library can be supported by adding a resultflow.json file to your project.
Using REslava.Result? Consider
REslava.Result.Flowfor richer diagrams with typed error edges and full semantic analysis.
Installation
dotnet add package REslava.ResultFlow
No extra using required — the [ResultFlow] attribute is injected into your compilation automatically by the source generator.
Quick Start
[ResultFlow]
public async Task<Result<UserDto>> RegisterAsync(RegisterCommand cmd) =>
await CreateUser(cmd)
.EnsureAsync(IsEmailValid, new InvalidEmailError())
.BindAsync(SaveUser)
.TapAsync(SendWelcomeEmail)
.MapAsync(ToDto);
Use the IDE code action to inject the diagram as a comment directly above the method — no build required:
/*
```mermaid
flowchart LR
N0_EnsureAsync["EnsureAsync"]:::gatekeeper
...
```*/
[ResultFlow]
public async Task<Result<UserDto>> RegisterAsync(RegisterCommand cmd) => ...
Or access the generated constant after build and paste it into any Mermaid renderer:
string diagram = Generated.ResultFlow.UserService_Flows.RegisterAsync;
// Paste into mermaid.live, GitHub, Notion, VS Code, or your wiki
Generated Diagram Example
flowchart LR
N0_EnsureAsync["EnsureAsync"]:::gatekeeper
N0_EnsureAsync -->|pass| N1_BindAsync
N0_EnsureAsync -->|fail| F0["Failure"]:::failure
N1_BindAsync["BindAsync"]:::transform
N1_BindAsync -->|ok| N2_TapAsync
N1_BindAsync -->|fail| F1["Failure"]:::failure
N2_TapAsync["TapAsync"]:::sideeffect
N2_TapAsync --> N3_MapAsync
N3_MapAsync["MapAsync"]:::transform
classDef gatekeeper fill:#e3e9fa,color:#3f5c9a
classDef transform fill:#e3f0e8,color:#2f7a5c
classDef sideeffect fill:#fff4d9,color:#b8882c
classDef failure fill:#f8e3e3,color:#b13e3e
Each operation is color-coded by semantic role:
- Lavender — gatekeepers (
Ensure) — can fail validation - Mint — transforms (
Bind/Map) — shape the result - Vanilla — side effects (
Tap) — fire-and-forget - Soft pink — failure paths
Supported Libraries
The built-in convention dictionary covers the most popular Result libraries out of the box — no configuration needed:
| Library | Methods recognized |
|---|---|
| REslava.Result | Ensure, Bind, Map, Tap, TapOnFailure, TapBoth, Match, WithSuccess (+ Async variants) |
| ErrorOr | Then, ThenAsync, Switch, SwitchAsync |
| LanguageExt | Filter, Do, DoAsync, DoLeft, DoLeftAsync |
Any unrecognized method is rendered as a generic operation node — the diagram is still generated.
Custom Method Classification — resultflow.json
Add a resultflow.json file to your project to classify custom or third-party methods. Config entries override the built-in dictionary.
{
"mappings": [
{
"bind": ["Chain", "AndThen"],
"map": ["Transform"],
"tap": ["Log", "Audit"],
"gatekeeper": ["Require"],
"terminal": ["Fold"]
}
]
}
Register it as an AdditionalFile in your .csproj:
<ItemGroup>
<AdditionalFiles Include="resultflow.json" />
</ItemGroup>
Supported keys: bind, map, tap, tapOnFailure, gatekeeper, terminal.
Code Action
The companion analyzer detects [ResultFlow] methods that are missing the diagram as a developer comment. A single-click code fix inserts the generated Mermaid diagram directly above the method body — so the diagram lives next to the code that produced it.
Diagnostics
| ID | Severity | Description |
|---|---|---|
REF001 |
Info | [ResultFlow] could not detect a fluent chain — diagram not generated. Check that the method body is an expression body or ends with a return of a fluent chain. |
REF003 |
Warning | resultflow.json could not be parsed — falling back to the built-in convention dictionary. Check the JSON syntax. |
Documentation
Full documentation: reslava.github.io/nuget-package-reslava-result
MIT License | Works with any .NET project (netstandard2.0)
| 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 was computed. 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. |
| .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. |
This package has no dependencies.
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.54.0 | 108 | 4/6/2026 |
| 1.53.0 | 100 | 4/5/2026 |
| 1.52.0 | 99 | 3/30/2026 |
| 1.51.0 | 121 | 3/28/2026 |
| 1.50.1 | 98 | 3/25/2026 |
| 1.50.0 | 99 | 3/25/2026 |
| 1.49.0 | 102 | 3/24/2026 |
| 1.48.0 | 97 | 3/22/2026 |
| 1.47.5 | 95 | 3/22/2026 |
| 1.47.4 | 96 | 3/21/2026 |
| 1.47.3 | 100 | 3/20/2026 |
| 1.47.2 | 99 | 3/20/2026 |
| 1.47.1 | 100 | 3/18/2026 |
| 1.47.0 | 99 | 3/18/2026 |
| 1.46.3 | 99 | 3/18/2026 |
| 1.46.2 | 97 | 3/18/2026 |
| 1.46.1 | 94 | 3/17/2026 |
| 1.46.0 | 96 | 3/17/2026 |
| 1.45.0 | 103 | 3/17/2026 |
| 1.44.1 | 135 | 3/16/2026 |