A lightweight implementation of the Result pattern for .NET, providing type-safe error handling without exceptions.
This repository contains three NuGet packages:
| Package | Description | Documentation |
|---|---|---|
| Kubis1982.Result | Core Result pattern library | 📖 Documentation |
| Kubis1982.Result.AspNet | ASP.NET Core integration | 📖 Documentation |
| Kubis1982.Result.WolverineFx | WolverineFx integration | 📖 Documentation |
# Core library
dotnet add package Kubis1982.Result
# ASP.NET Core integration
dotnet add package Kubis1982.Result.AspNet
# WolverineFx integration
dotnet add package Kubis1982.Result.WolverineFx- Type-safe error handling: Use
ResultandResult<T>types to represent success or failure without throwing exceptions - Railway-oriented programming: Build robust error-handling pipelines
- Minimal dependencies: Pure .NET implementation with no external packages
- ASP.NET Core integration: Seamless conversion to IResult and ProblemDetails
- WolverineFx integration: Message handler support with automatic continuation strategies
- Rich error types: Structured
Errorwith codes, descriptions, and error types - Pattern matching:
Matchmethod enforces exhaustive handling of success/failure cases - Tuple deconstruction: Use pattern matching with
Deconstructmethod - TryGetValue pattern: Safe value extraction without exceptions
- Combine operations: Compose multiple results with fail-fast behavior
- Async support: Full
MapAsync/BindAsyncsupport for asynchronous operations
Each package has its own detailed documentation:
- Kubis1982.Result - Core library with Result pattern implementation
- Kubis1982.Result.AspNet - ASP.NET Core extensions and HTTP integration
- Kubis1982.Result.WolverineFx - WolverineFx message handling integration
The project includes comprehensive test suites for all packages:
- Kubis1982.Result.Tests - Unit tests for the core Result library
- Kubis1982.Result.AspNet.Tests - Unit tests for ASP.NET Core extensions
- Kubis1982.Result.WolverineFx.Tests - Integration tests for WolverineFx extensions
# Run all tests
dotnet test
# Run tests for specific project
dotnet test tests/Result.Tests/Kubis1982.Result.Tests.csproj
dotnet test tests/Result.AspNet.Tests/Kubis1982.Result.AspNet.Tests.csproj
dotnet test tests/Result.WolverineFx.Tests/Kubis1982.Result.WolverineFx.Tests.csproj- xUnit v3 - Modern testing framework
- Coverlet - Code coverage collection
- Microsoft.NET.Test.Sdk - Test platform integration
This repository uses automated CI/CD for publishing releases:
- Automated Releases: Creating a version tag (e.g.,
v1.2.0) triggers the full release pipeline - NuGet Publishing: Packages are automatically published to NuGet.org
This project is licensed under the MIT License - see the LICENSE file for details.
Kubis1982
- GitHub: @kubis1982
- Project: Result