RA.Utilities.Core.Results
Version 10.1.1
The Result extension methods are reorganized into four classes under the new RA.Utilities.Core.Results.Extensions namespace, and every method is now declared as a C# 14 extension member. Method names and call-site syntax are unchanged.
⚠️ Breaking Changes
- Extensions moved to the
RA.Utilities.Core.Results.Extensionsnamespace:ResultandResult<T>stay inRA.Utilities.Core.Results, but the chaining methods (Map,Bind,OnSuccess,OnFailure,Match, and their async counterparts) now requireusing RA.Utilities.Core.Results.Extensions;. Without it, call sites no longer compile (CS1061, "no accessible extension method"). Migration: see the migration guide. ResultExtensionssplit into four classes:ResultExtensions(methods onResult),TypedResultExtensions(onResult<T>),ResultAsyncExtensions(onTask<Result>) andTypedResultAsyncExtensions(onTask<Result<T>>). Call sites are unaffected — only code that references theResultExtensionsclass by name (typeof(...), static invocation, reflection) breaks.
📝 Improvements
- All extension methods are declared with C# 14 extension members inside
extension(...)blocks on their target type. The generated methods have identical names and signatures, so the reorganization is source-compatible for every extension-method call site.
Version 10.0.0
The project version has been updated from 10.0.100-rc.2 to the stable release version 10.0.0 in preparation for a production release.
Version 10.0.100-rc.2
This is the initial release of RA.Utilities.Core, a lightweight .NET library designed to enhance error handling by providing a functional Result type. It helps you write cleaner, more predictable, and more robust code by avoiding exceptions for expected operational failures.
✨ Key Features
-
Functional
ResultandResult<T>Types:- Provides
Resultfor operations that don't return a value andResult<T>for those that do. - Clearly separates success and failure paths, making your code's intent explicit.
- The
Matchmethod ensures that both success and failure cases are handled, preventing unhandled errors.
- Provides
-
Railway-Oriented Programming Extensions:
- Includes a fluent API for chaining multiple operations that can fail.
Map(): Transforms the value inside a successfulResult<T>.Bind(): Chains multiple functions that each return aResult.OnSuccess()/OnFailure(): Executes side-effects like logging without altering the result.
-
Asynchronous Support:
- Provides
asyncversions of all extension methods (MapAsync,BindAsync, etc.) to seamlessly integrate with asynchronous workflows.
- Provides
-
Implicit Conversions:
- Simplifies your code by allowing implicit conversions from a value to a success
Result<T>and from anExceptionto a failureResult.
- Simplifies your code by allowing implicit conversions from a value to a success
🚀 Getting Started
Install the package via the .NET CLI:
dotnet add package RA.Utilities.Core