SzakatsA.Result
1.1.0
dotnet add package SzakatsA.Result --version 1.1.0
NuGet\Install-Package SzakatsA.Result -Version 1.1.0
<PackageReference Include="SzakatsA.Result" Version="1.1.0" />
<PackageVersion Include="SzakatsA.Result" Version="1.1.0" />
<PackageReference Include="SzakatsA.Result" />
paket add SzakatsA.Result --version 1.1.0
#r "nuget: SzakatsA.Result, 1.1.0"
#:package SzakatsA.Result@1.1.0
#addin nuget:?package=SzakatsA.Result&version=1.1.0
#tool nuget:?package=SzakatsA.Result&version=1.1.0
SzakatsA.Result
SzakatsA.Result is a lightweight, extensible C# library that provides a robust implementation of the Result pattern. It’s designed to encapsulate success and failure outcomes in a clean, expressive, and type-safe manner.
Features
- Represent results with or without values
- Support for strongly-typed errors
- Multiple exceptions per failure
- Minimal, dependency-free API
- Public domain licensing (Unlicense)
Usage
Basic Result (No Value)
using SzakatsA.Result;
Result successful = Result.Success();
Result failed = Result.Fail(new NotImplementedException());
Result With Value
using SzakatsA.Result;
Result<string> successfulWithValue = Result.Success("This is the value of the successful attempt");
Result<string> failedWithValue = Result.Fail(new NotSupportedException("There is no value associated when an attempt fails"));
Result with Value and typed Error
using SzakatsA.Result;
Result<string, int> failedWithTypedError = Result.Fail(32); //e.g., an error code
Checking Result State
using SzakatsA.Result;
Result<string, int> result = Result.Fail(64);
if (result.IsSuccessful)
{
string value = result.Value;
}
else
{
int errorCode = result.Error;
Exception[] exceptions = result.Exceptions;
Exception? combinedException = result.Exception;
}
The Exception property contains:
- null if no exceptions were registered
- A single exception if only one was registered
- An AggregateException if multiple exceptions were registered
License
SzakatsA.Result is released under the Unlicense.
This means:
- ✅ You can freely use, modify, distribute, or sell the software
- ❌ No warranties or guarantees are provided
- 💼 Suitable for both personal and commercial use
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to https://unlicense.org/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 229 | 6/16/2025 |