-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Resultron wiki! This wiki explains the project in simple English, so anyone can understand it, even if you are new to the "Result pattern."
Resultron is a small C# library. It helps you handle success and failure in your code without using exceptions all the time.
Normally, when something goes wrong in C#, you throw an exception. Exceptions are useful, but they can be slow and hard to control. Resultron gives you another way: a Result object. This object simply tells you:
- Did the operation succeed? ✅
- Or did it fail? ❌ (and why)
-
Cleaner code: No need for many
try/catchblocks everywhere. -
Clear errors: Every failure has a
Codeand aDescription, so you know exactly what went wrong. -
Fluent chains: You can connect multiple steps together with
MapandBind, like a pipeline. -
Works with async code: You can use it with
async/awaittoo. - Small and simple: The library is lightweight and easy to learn.
Use the sidebar (or the links below) to explore the wiki:
- Installation – How to add Resultron to your project.
-
Core Concepts – Understand
Result,Result<T>, andError. -
Result API Reference – All methods on
Result. -
Result API Reference – All methods on
Result<T>. - Chaining with Map and Bind – How to build pipelines.
-
Handling Exceptions with Try – Turn exceptions into
Resultobjects. -
Async Operations – Using
TryAsyncwithasync/await. - Full Example – A complete, realistic example (a simple user management app).
- FAQ – Common questions and answers.
Here is a small taste of what Resultron code looks like:
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: 20No try/catch block is written by you. Resultron does the exception-catching for you, and gives you a clean Result object instead.
- Language: C#
- Target Framework: .NET 10
- License: MIT
- NuGet Package: Resultron
- Repository: ferdikurnazdm/Resultron
Note: The project description mentions extra features like "error aggregation" and "paged results." These are planned for the future. As of the current version, the library focuses on the core
Result/Result<T>pattern described in this wiki.