RA.Utilities.Core
· 2 min read
RA.Utilities.Core 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