Resultron 1.4.1
dotnet add package Resultron --version 1.4.1
NuGet\Install-Package Resultron -Version 1.4.1
<PackageReference Include="Resultron" Version="1.4.1" />
<PackageVersion Include="Resultron" Version="1.4.1" />
<PackageReference Include="Resultron" />
paket add Resultron --version 1.4.1
#r "nuget: Resultron, 1.4.1"
#:package Resultron@1.4.1
#addin nuget:?package=Resultron&version=1.4.1
#tool nuget:?package=Resultron&version=1.4.1
Resultron
Resultron is a lightweight, fluent, and functional-style Result library for C#.
It provides Result and Result<T> types with Try, Map, Bind, and Match operations,
enabling safe error handling, fluent pipelines, and exception-free code.
Why Resultron?
Exceptions can make control flow unpredictable and expensive.
Resultron provides a functional approach to error handling with explicit success and failure states.
Features
- Fluent API with
Try,TryAsync,Map,Bind,Match - Non-generic and generic
Resulttypes - Exception-safe operations with
Result.TryandResult.TryAsync - Fully chainable pipelines for functional programming style
- Structured errors with
CodeandDescription
Installation
You can install the package via NuGet:
dotnet add package Resultron
Quick Example
string input = "10";
var message =
Result.Try(() => int.Parse(input))
.Bind(x => Result.Success(x * 2))
.Match(
onSuccess: value => $"Result: {value}",
onFailure: error => $"Error: {error.Description}"
);
Console.WriteLine(message); // Result: 20
Chaining Example
var result = Result.Success()
.Bind(ValidateName)
.Bind(ValidateEmail)
.Bind(SaveUser)
.Match(
onSuccess: () => "User created successfully.",
onFailure: error => $"Failed: {error.Description}"
);
Async Example
var result = await Result.TryAsync(async () =>
{
await _repository.SaveAsync(entity);
});
result.Match(
onSuccess: () => Console.WriteLine("Saved."),
onFailure: error => Console.WriteLine($"Error: {error.Description}")
);
Documentation
See the full documentation.
Contributing
Please read CONTRIBUTING.md before submitting pull requests.
Changelog
See CHANGELOG.md for release history.
License
MIT License — see LICENSE.
Code of Conduct
See CODE_OF_CONDUCT.md.
Security
See SECURITY.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- 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.