MisterMoret.Results 1.0.0-beta.5

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

MisterMoret.Results

License: MIT NuGet .NET 8.0 .NET 9.0 .NET 10.0 NuGet GitHub

A lightweight implementation of the Result pattern for .NET applications, providing a robust way to handle operation outcomes without relying on exceptions for flow control.

This package is currently in beta and available via NuGet.org.

✨ Features

  • Generic Result<T>: Wrap operation outcomes with data and error information.
  • Web API Specialized: HttpResult includes HTTP status codes for seamless API integration.
  • Clean Flow Control: Avoid "exception-driven development" by using success/failure states.
  • Error Collection: Collect and report multiple errors from a single operation.
  • Modern .NET Support: Targets .NET 8.0, 9.0, and 10.0.

🚀 Installation

Install the package via the NuGet CLI:

dotnet add package MisterMoret.Results --version 1.0.0-beta.5

💡 Usage

Simple Result

using MisterMoret.Results;

public Result<string> GetGreeting(string name)
{
    if (string.IsNullOrEmpty(name))
    {
        return Result<string>.Failure("Name cannot be empty.");
    }
    return Result<string>.Success($"Hello, {name}!");
}

// Consuming
var result = GetGreeting("Frédéric");
if (result.IsSuccess)
{
    Console.WriteLine(result.Value);
}
else
{
    foreach (var error in result.Errors)
    {
        Console.WriteLine($"Error: {error}");
    }
}

HttpResult

Perfect for Web API controllers where the status code needs to be explicitly set.

using System.Net;
using MisterMoret.Results;

public HttpResult UpdateUser(int id, User user)
{
    if (id <= 0)
    {
        return HttpResult.Failure("Invalid ID", HttpStatusCode.BadRequest);
    }
    
    // ... logic ...
    
    return HttpResult.Success(HttpStatusCode.NoContent);
}

⚖️ License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Frédéric Goetinck-Moret

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 (2)

Showing the top 2 NuGet packages that depend on MisterMoret.Results:

Package Downloads
MisterMoret.Http

A simple and extensible API client wrapper for .NET applications.

MisterMoret.Try

A lightweight try/catch wrapper that converts unhandled exceptions into failed Result or HttpResult objects, eliminating boilerplate exception handling in .NET applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-beta.5 107 5/25/2026