Migration Guides (v1 -> v2 -> v3)
Upgrade paths across the three published NuGet majors (v1.0.0 → v2.0.0 → v3.0.0), grounded directly in CHANGELOG.md breaking-change records (BC-001 through BC-019).
Migrating v1.0.0 to v2.0.0 (BC-001–BC-011)
Section titled “Migrating v1.0.0 to v2.0.0 (BC-001–BC-011)”- Replace
FinallywithInspectandFoldErrorwithMapFailure:v1.0.0 // var mapped = result.FoldError(err => Error.Failure("Mapped", err.Description));// result.Finally(r => Log(r));// v2.0.0+string mapped = result.MapFailure(static err => $"Error: {err.Description}", "OK");Result remapped = result.MapError(static err => Error.Failure("Mapped", err.Description));result.Inspect(static r => Log(r)); - Replace
Result<T>.ToResult()/WithoutValue()with.DiscardValue():Result nonGeneric = typedResult.DiscardValue(); - Update
ResultMetricsstatic calls: ReplaceRecordSuccess/RecordFailurewithResultMetrics.StaticTrackSuccess/StaticTrackFailure. - External package major upgrades:
FluentValidationv12,MediatRv14,NUnit 4.6.1,xunit.v3.assert 4.0.0.
Migrating v2.0.0 to v3.0.0 (BC-012–BC-019)
Section titled “Migrating v2.0.0 to v3.0.0 (BC-012–BC-019)”- Uninitialized
Result<T, E>&defaultguard:default(Result<T>)now reportsIsFailure == falseandToString() == "Uninitialized". Always returnResult.Success(...)orResult.Failure(...). - JSON depth limit:
ErrorJsonConverter.MaxAllowedDepthis capped at32to guard against deeply nested inner-error payloads. - FluentValidation PII redaction: Sensitive property names (
password,token,secret,cvv, etc.) are automatically masked as"[REDACTED]". - Telemetry & JSON discriminator: OpenTelemetry tags emit
result.outcome = "uninitialized"and JSON serialization includes"isUninitialized": truefor default structs.