️ Pipeline Visualization — `[ResultFlow]`
Annotate any fluent pipeline with [ResultFlow] and with single-click code action ResultFlow will insert a Mermaid diagram comment so you can visualize every success path, failure branch, and side effect in your pipeline — zero runtime overhead, zero maintenance.
/*
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 failure fill:#f8e3e3,color:#b13e3e
classDef transform fill:#e3f0e8,color:#2f7a5c
classDef sideeffect fill:#fff4d9,color:#b8882c
*/
[ResultFlow]
public async Task<Result<UserDto>> RegisterAsync(RegisterCommand cmd)
{
return await CreateUser(cmd)
.EnsureAsync(IsEmailValid, new InvalidEmailError())
.BindAsync(SaveUser)
.TapAsync(SendWelcomeEmail)
.MapAsync(ToDto);
}
Paste the comment into any Mermaid renderer to instantly see the data flow.
Each operation is color-coded by semantic role: lavender = gatekeepers (Ensure), mint = transforms (Bind/Map), vanilla = side effects (Tap), soft pink = failure paths.