EricksonLopez.Result Overview
EricksonLopez.Result (3.0.0 on NuGet, L0) is the central dependency hub of the ecosystem, referenced directly by 21 sibling libraries (20 published + 1 unpublished local observability). It models expected success and failure outcomes with readonly partial struct Result, readonly struct Result<TValue>, and the sealed Error taxonomy instead of exception-driven control flow (ADR-001).
- Zero heap allocation on happy paths:
ResultandResult<TValue>arereadonly structvalue types passed efficiently withinoverloads (ResultSyncExtensions). - Closure-free
TStatecombinators:Map,Bind,Ensure,Tap,Match, andRecoveraccept state tuples withstaticlambdas (RESULT004). - Rich error taxonomy:
ErrorcarriesErrorType,ErrorSeverity,ErrorRetryability, lazy ambientTraceId,CorrelationId, andImmutableArray<Error>inner errors. - Explicit non-generic vs generic contract: Operations without a payload return non-generic
Result(Result.Success()/Result.Failure(error)), while operations returning a payload returnResult<TValue>.
Rendering diagram…
flowchart LR In["Input / Command"] --> E["Ensure(predicate, error)"] E -- IsSuccess --> B["Bind(nextStep)"] E -- IsFailure --> F["Error Track"] B -- IsSuccess --> M["Map(projection)"] B -- IsFailure --> F M --> Out["Match(onSuccess, onFailure)"] F --> Out
View accessible text summary and structure
Input flows sequentially through Ensure, Bind, and Map on the success track, short-circuiting immediately to Error on the failure track until Match produces an HTTP or domain output.
flowchart LR
In["Input / Command"] --> E["Ensure(predicate, error)"]
E -- IsSuccess --> B["Bind(nextStep)"]
E -- IsFailure --> F["Error Track"]
B -- IsSuccess --> M["Map(projection)"]
B -- IsFailure --> F
M --> Out["Match(onSuccess, onFailure)"]
F --> OutPackage Roster & Native AOT Status (20 / 20 Published)
Section titled “Package Roster & Native AOT Status (20 / 20 Published)”All 20 packages in dotnet-result are published on NuGet (3.0.0 latest published; localVersion: 3.2.0 on disk with uncommitted [4.0.0] changelog):
| Package | AOT Status | TFMs | Role |
|---|---|---|---|
EricksonLopez.Result |
Full |
netstandard2.0;net8.0;net9.0;net10.0 |
Core Result, Result<T>, Error, Combine, ValidateAll, bundled analyzers |
EricksonLopez.Result.Generic |
Full |
net8.0;net9.0;net10.0 |
Result<TValue, TError> custom typed errors |
EricksonLopez.Result.Maybe |
Full |
net8.0;net9.0;net10.0 |
Maybe<T> optional struct with .ToResult(Error) |
EricksonLopez.Result.AspNetCore |
Full |
net8.0;net9.0;net10.0 |
RFC 9457 ProblemDetails, AddResultEndpointFilter, ToHttpResult() |
EricksonLopez.Result.OpenApi |
Full |
net8.0;net9.0;net10.0 |
ProducesResult<T>(), ProducesResultProblemDetails() |
EricksonLopez.Result.OpenTelemetry |
Full |
net8.0;net9.0;net10.0 |
AddResultMetrics, TraceOutcome activity instrumentation |
EricksonLopez.Result.FluentValidation |
Full |
net8.0;net9.0;net10.0 |
ValidateToResult() with automatic PII redaction |
EricksonLopez.Result.EntityFrameworkCore |
Full |
net8.0;net9.0;net10.0 |
SaveChangesAsyncToResult, query ToResultAsync helpers |
EricksonLopez.Result.Polly |
Full |
net8.0;net9.0;net10.0 |
AddResultRetry resilience pipelines |
EricksonLopez.Result.Dapr |
Full |
net8.0;net9.0;net10.0 |
DaprResultStateExtensions, DaprResultPubSubExtensions |
EricksonLopez.Result.Grpc |
Full |
net8.0;net9.0;net10.0 |
ResultServerInterceptor, GrpcErrorMapper |
EricksonLopez.Result.Testing |
Full |
net8.0;net9.0;net10.0 |
ShouldBeSuccess(), ShouldBeFailure(), ShouldHaveErrorCode() |
EricksonLopez.Result.MassTransit |
Incompatible |
net8.0;net9.0;net10.0 |
ResultConsumeFilter<TMessage> (IsAotCompatible=false, EnableTrimAnalyzer=true) |
EricksonLopez.Result.MediatR |
Incompatible |
net8.0;net9.0;net10.0 |
ResultExceptionBehavior<TReq, TRes> ([RequiresDynamicCode]) |
EricksonLopez.Result.Serialization |
Incompatible |
netstandard2.0;net8.0;net9.0;net10.0 |
Reflection-aware fallback JsonConverter (IsAotCompatible=false) |
EricksonLopez.Result.Testing.NUnit / .XUnit |
Incompatible |
net8.0;net9.0;net10.0 |
Framework-specific assertion adapters (IsAotCompatible=false) |
EricksonLopez.Result.Analyzers |
NotApplicable |
netstandard2.0 |
Roslyn diagnostics RESULT001–RESULT013, RESULT_OTEL_001 |
EricksonLopez.Result.DomainErrors.Generators |
NotApplicable |
netstandard2.0 |
Source generator for *.errors.json (RESULT_DOM_001–003) |
EricksonLopez.Result.Serialization.Generators |
NotApplicable |
netstandard2.0 |
STJ source-generation analyzer (RESULT_GEN_001) |
Measured directly from BenchmarkDotNet.Artifacts (422 measured rows on .NET 8/.NET 9/.NET 10 X64 RyuJIT; 3 na_error rows in MediatRColdStartBenchmarks and NativeAOT reports absent):
CompetitorCopySemanticsBenchmarks.EricksonLopez_PassByIn: 0.7981 ns / 0 B (.NET 8.0.29X64 RyuJITx86-64-v4, AMD Ryzen 7 9800X3D)ResultPipelineBenchmarks.Bind_Failure_Lambda: 3.73 ns / 0 BCompetitorDictionaryBenchmarks.EricksonLopez_TryGetValue: 5.274 ns / 0 BValidationBenchmarks.ValidateAll_AllSuccess: 12.33–24.74 ns / 0 B