Koras.Results 0.1.0-preview.1

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

Koras.Results

A lightweight, strongly typed Result pattern and standardized error-handling library for .NET — the zero-dependency core of the Koras.Results family.

using Koras.Results;

public Result<Order> Place(PlaceOrder cmd) =>
    _catalog.Find(cmd.Sku)                                   // Result<Product>
        .Ensure(p => p.Stock >= cmd.Qty,
                p => Error.Conflict("Order.InsufficientStock", $"Not enough '{p.Sku}'."))
        .Map(p => Order.Create(p, cmd.Qty));

var message = result.Match(
    order => $"Placed {order.Id}",
    error => $"Rejected: {error.Code}");

Features

  • Result / Result<T> as allocation-free readonly structs — success allocates nothing
  • Semantic error taxonomy (Validation, NotFound, Conflict, Unauthorized, Forbidden, Unavailable, Failure, Unexpected) with stable error codes and metadata
  • ValidationError with field-level errors
  • Functional composition: Map, Bind, Match, Ensure, Tap, MapError — sync and async
  • Result.Try / Result.TryAsync exception boundaries (cancellation always propagates)
  • Result.Combine failure aggregation
  • System.Text.Json serialization out of the box
  • Full nullable-reference-type annotations

Companion packages

Package Purpose
Koras.Results.AspNetCore RFC 9457 ProblemDetails, Minimal API + MVC integration
Koras.Results.FluentValidation FluentValidation → Result conversion
Koras.Results.MediatR Validation pipeline behavior for MediatR 12.x
Koras.Results.OpenTelemetry Activity error tagging

Documentation: https://github.com/korastechnologies/koras-results/tree/main/docs

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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Koras.Results:

Package Downloads
Koras.Results.AspNetCore

ASP.NET Core integration for Koras.Results: converts Result failures into RFC 9457 ProblemDetails responses with configurable status-code mapping, Minimal API IResult adapters, MVC IActionResult adapters, validation-error dictionaries, localization hooks, and secure-by-default error detail handling.

Koras.Results.FluentValidation

FluentValidation integration for Koras.Results: converts ValidationResult and ValidationFailure into typed ValidationError values, and provides ValidateToResult / ValidateToResultAsync for validating directly into Result<T>.

Koras.Results.MediatR

MediatR integration for Koras.Results: a validation pipeline behavior that runs FluentValidation validators and short-circuits with a failed Result instead of throwing ValidationException. Depends on MediatR 12.x (Apache-2.0 licensed versions).

Koras.Results.OpenTelemetry

OpenTelemetry-friendly observability for Koras.Results: tags the current System.Diagnostics.Activity with error.type and koras.error.code on failures, following OpenTelemetry semantic conventions. Depends only on System.Diagnostics.DiagnosticSource — composes with any OpenTelemetry SDK setup.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.1 102 7/16/2026