Fafp.ResultPattern 1.0.0

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

Русская версия | English

Faf.Shared.ResultPattern

Result Pattern library for type-safe error handling without exceptions. Part of the Firefly AI Flow Platform.


ASP.NET 10 C# 13 NuGet License

GitHub: Kotrecon/faf.result-pattern


Components

Core (Faf.ResultPattern.Common)

  • Result — Operation result without a return value
  • Result<T> — Operation result with a return value
  • IError — Business error interface
  • ValidationError, NotFoundError, ConflictError, ForbiddenError, BusinessRuleError

Web Adapter (Faf.ResultPattern.Web)

  • ResultExtensions — .ToActionResult() extension for mapping Result → IActionResult

Installation

dotnet add package Faf.ResultPattern

Usage

using Faf.ResultPattern.Common;
using Faf.ResultPattern.Web;

public Result<User> GetUser(Guid id)
{
    if (id == Guid.Empty)
        return Result<User>.Failure(new ValidationError("Invalid ID"));

    var user = _repository.GetById(id);
    if (user == null)
        return Result<User>.Failure(new NotFoundError("User", id.ToString()));

    return Result<User>.Success(user);
}

// In the controller
var result = _service.GetUser(id);
return result.ToActionResult();

Documentation

Full documentation: result-pattern.md

Roadmap

✅ v1.0.0 — Core + Web Adapter
🔄 v1.1.0 — Async validation
📋 v1.2.0 — Localization
📋 v1.3.0 — Advanced error types

Author

@Kotrecon
Solution Architect from Saint Petersburg. Specialization: .NET, C#, JS, Python, AI/ML, RAG, Agents, DevOps, GitHub, GitLab, CI/CD, Industrial Automation, Industrial Software, DB, PostgreSQL.

Telegram | Email

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 137 7/3/2026