LoomKit.Esits 10.0.1

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

LoomKit.Esits

A lightweight Result/Either-style outcome type for .NET. Esit and Esit<TValue> represent the outcome of an operation — success, or a structured Error — without relying on exceptions for control flow.

Status: early stage. The public API may still change between versions — pin a commit/tag if you depend on it.

Why

Returning Esit/Esit<TValue> from a method instead of throwing lets callers branch on IsSuccess/IsFailure explicitly, and lets you compose outcomes with Map, Match, Switch and EnsureAllSucceeded instead of scattering try/catch blocks through application code. Error carries a Code/SubCode/Message, optional structured Details, and an optional wrapped Exception, so a failure can be inspected and handled without ever throwing.

Installation

dotnet add package LoomKit.Esits

Available on nuget.org — a package version is published automatically for every vX.Y.Z tag pushed to this repo.

Usage

using LoomKit.Esits;
using LoomKit.Esits.Errors;
using LoomKit.Esits.Extensions;

Esit<User> GetUser(string id)
{
    var user = _repository.Find(id);

    return user is not null
        ? Esit.Success(user)
        : Esit<User>.Failure(GenericErrors.NotFoundError(typeof(User), id));
}

var esit = GetUser("42");

// branch on the outcome
esit.Switch(
    success: user => Console.WriteLine($"Found {user.Name}"),
    failure: error => Console.WriteLine($"{error.Code}: {error.Message}"));

// or fold it into a value
string message = esit.Match(
    success: user => user.Name,
    failure: error => error.Message);

// or transform the success value while short-circuiting on failure
Esit<string> nameEsit = esit.Map(user => user.Name);

Contents

Type Kind Purpose
Esit class Non-generic outcome: IsSuccess/IsFailure and an Error?.
Esit<TValue> class Outcome carrying a Value on success.
Error class Code, SubCode, Message, structured Details, optional wrapped Exception.
GenericErrors static class Ready-made Error factories: not found, conflict, validation, unauthorized, forbidden, unsuccessful HTTP status code, unexpected, ...
FailedEsitException exception Wraps a failed Esit for the rare case where throwing is the right call.
EsitExtensions static class Map, Match, Switch, AsTask, ToEsit, EnsureAllSucceeded.
ErrorExtensions static class ToEsit, AsTask, AddDetail.

License

MIT

Product Compatible and additional computed target framework versions.
.NET 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.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LoomKit.Esits:

Package Downloads
LoomKit.Requests.Crud

Generic CRUD base-handler classes for LoomKit.Requests: Create/GetById/List/UpdateById/DeleteById/Import/UpdateRelatedById request-handler triads with SQL-level field projection, a repository/unit-of-work contract, and auditing hooks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1 192 8/25/2026