VOOZH about

URL: https://www.nuget.org/packages/Odin.System.Result/

⇱ NuGet Gallery | Odin.System.Result 0.9.140




👁 Image
Odin.System.Result 0.9.140

dotnet add package Odin.System.Result --version 0.9.140
 
 
NuGet\Install-Package Odin.System.Result -Version 0.9.140
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Odin.System.Result" Version="0.9.140" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Odin.System.Result" Version="0.9.140" />
 
Directory.Packages.props
<PackageReference Include="Odin.System.Result" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Odin.System.Result --version 0.9.140
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Odin.System.Result, 0.9.140"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Odin.System.Result@0.9.140
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Odin.System.Result&version=0.9.140
 
Install as a Cake Addin
#tool nuget:?package=Odin.System.Result&version=0.9.140
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

About Odin.System.Result

👁 NuGet
👁 Nuget

Odin.System.Result, part of the OrDinary INfrastructure libraries, provides several 'Result' classes, which all encapsulate the outcome of an operation, together with a list of messages.

Result is the simplest concept.

ResultValue of TValue adds a generic Value property.

Result of TMessage and ResultValue of TValue, TMessage add support for the Messages list to be of any type.

ResultEx and ResultValueEx of TValue come with a TMessage type that is aligned with logging failure issues.

Getting Started

1 - Result: Success() and Failure()

 public class HeartOfGoldService
 {
 public Result WarpSpeedToMilliways()
 {
 if (_eddie.IsOK()) return Result.Success();
 return Result.Failure(["Zaphod, that is not possible...", "Error 42"])
 }
 }

2 - Result: IsSuccess and Messages properties

 Result outcome = _heartOfGold.WarpSpeedToMilliways()
 if (!outcome.IsSuccess)
 {
 outcome.Messages.ForEach(m => _logger.LogWarning(m));
 } 
 

3 - ResultValue:

Adds a generic Value property to Result.

 public class ZaphodMemoryFetcherService
 {
 public ResultValue<IReadonlyList<MemSnippet>> 
 FetchMemoriesFor(Source source, DateOnly day)
 {
 var results = new List<MemSnippet>();
 ...
 ...
 // On success...
 return ResultValue<IReadonlyList<MemSnippet>>.Success(results);

 // On failure...
 return ResultValue<IReadonlyList<MemSnippet>>.Failure("Tampering detected!")
 }
 }

4 - ResultValue: IsSuccess, Value and Messages properties

 ResultValue<IReadonlyList<MemSnippet>> outcome = 
 _zaphod.FetchMemoriesFor(_milliwaysDinner, DateOnly.MaxValue)
 if (outcome.IsSuccess)
 {
 var memories = outcome.Value;
 }
 else
 {
 outcome.Messages.ForEach(m => _logger.LogWarning(m));
 } 
 

5 - Result & ResultValue Messages can also be of type TMessage, as opposed to just string.

 public record MyMessage(int EventId, string Message)
 Result<MyMessage> result = Result<MyMessage>.Failure(
 new MyMessage(134, "Some message"));
 ...
 result.Messages.ForEach(m => _logger.LogWarning(m.EventId, m.Message));

6 - ResultEx & ResultValueEx

Uses a message type that is aligned with logging...

 ResultEx result = ResultEx.Failure(LogLevel.Critical, 
 "Zaphod has broken the improbability drive", unhandledWarpExceptionCaught);
 ...
 MessageEx message = result.Messages[0];
 _logger.Log(message.Severity, message.Error, message.Message); 

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (14)

Showing the top 5 NuGet packages that depend on Odin.System.Result:

Package Downloads
Odin.Common

Common elements used in the OrdinaryInfrastructure libraries, including logging, design contract elements, and various other elements. Odin = OrDinary INfrastructure.

Odin.Email

Provides a simple EmailMessage object model and IEmailSender interface for out of the box sending of email through any email sending service. Mailgun, Office365 (via MS Graph) and SMTP currently supported.

Odin.BackgroundProcessing

A now redundant abstraction of Hangfire's job processing functionality for the original purpose of mocking Hangfire. Abstracts background processing related use cases via an IBackgroundProcessor interface, required in the days that Hangfire still has static entry points to its functionality.

Odin.Cryptography

Originally intended as a wrapper for ordinary use cases around .NET DataProtection APIs. Provides a simple ICryptographer concept supporting Encrypt and Decrypt.

Odin.BackgroundProcessing.Abstractions

A now redundant abstraction of Hangfire's job processing functionality for the original purpose of mocking Hangfire. Abstracts background processing related use cases via an IBackgroundProcessor interface, required in the days that Hangfire still has static entry points to its functionality.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.140 388 6/10/2026
0.9.139 360 6/9/2026
0.9.138 376 6/9/2026
0.9.137 363 6/9/2026
0.9.135 370 6/7/2026
0.9.121 360 6/5/2026
0.9.120 352 6/5/2026
0.9.107 357 6/3/2026
0.9.105 576 5/26/2026
0.9.103 356 5/26/2026
0.9.102 374 5/25/2026
0.9.101 404 5/25/2026
0.9.100 383 5/21/2026
0.9.92 431 5/20/2026
0.9.88 370 5/20/2026
0.9.86 357 5/20/2026
0.9.85 472 5/20/2026
0.9.77 402 5/15/2026
0.9.76 355 5/15/2026
0.9.75 375 5/14/2026
Loading failed