Arkn.Results 0.3.2

dotnet add package Arkn.Results --version 0.3.2
                    
NuGet\Install-Package Arkn.Results -Version 0.3.2
                    
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="Arkn.Results" Version="0.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arkn.Results" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="Arkn.Results" />
                    
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 Arkn.Results --version 0.3.2
                    
#r "nuget: Arkn.Results, 0.3.2"
                    
#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 Arkn.Results@0.3.2
                    
#: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=Arkn.Results&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=Arkn.Results&version=0.3.2
                    
Install as a Cake Tool

Arkn.Results

Conventions you can read. Patterns you can enforce.

Result<T> and Error — business failures as first-class types. No exceptions for domain logic.

Install

dotnet add package Arkn.Results

Quick example

// Return results, never throw
public Result<User> GetUser(Guid id)
{
    var user = _repo.Find(id);
    return user is null
        ? Error.NotFound("User.NotFound", $"User {id} not found.")
        : Result.Success(user);
}

// Consume with Match
return result.Match(
    onSuccess: user  => Ok(user),
    onFailure: error => error.Type switch
    {
        ErrorType.NotFound   => NotFound(),
        ErrorType.Validation => BadRequest(error.Message),
        _                    => Problem(error.Message)
    });

API

// Factories
Result.Success()                    // void success
Result.Success(value)               // typed success
Result<T>.Ok(value)                 // shorthand
Result.Failure(error)               // void failure
Result<T>.Fail(error)               // typed failure
Result<T>.Fail(errors)              // multiple errors

// Error factories — message is optional (defaults to code)
Error.NotFound("User.NotFound")                          // concise
Error.NotFound("User.NotFound", $"User '{id}' not found.") // explicit
Error.Validation("Order.QuantityInvalid")
Error.Conflict("Email.AlreadyRegistered")
Error.Unauthorized("Auth.TokenExpired")

// Chaining
result.Map(v => transform(v))
      .Bind(v => nextOperation(v))
      .Tap(v => sideEffect(v))
      .Match(onSuccess, onFailure);

ErrorGroup pattern

Group all errors for a domain in one static class:

public static class UserErrors
{
    public static Error NotFound(Guid id) =>
        Error.NotFound("User.NotFound", $"User '{id}' not found.");

    public static readonly Error InvalidEmail =
        Error.Validation("User.InvalidEmail", "Email is invalid.");

    public static readonly Error EmailAlreadyRegistered =
        Error.Conflict("User.EmailAlreadyRegistered", "Already in use.");
}

// Usage
return user is null ? UserErrors.NotFound(id) : Result.Success(user);

Part of the Arkn ecosystem

github.com/fernando-terra/arkn · nuget.org/packages/Arkn.Results

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Arkn.Results:

Package Downloads
Arkn.Jobs

Zero-dependency job scheduling for .NET 10 — cron, retry, timeout and structured logs per run.

Arkn.Http

Fluent, typed HTTP client for modern .NET — returns Result<T> natively. Zero external dependencies.

Arkn.Repository

Advanced repository patterns and specifications for Arkn. Agnostic data access abstractions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.2 246 5/30/2026
0.3.1 165 5/28/2026
0.3.0 139 5/6/2026
0.2.0 147 5/6/2026
0.1.6 139 5/4/2026
0.1.5 134 5/4/2026
0.1.4 141 5/4/2026
0.1.3 147 5/4/2026
0.1.2 125 5/4/2026
0.1.1 134 5/4/2026
0.1.0 128 5/4/2026