Pitasoft.Result.AspNetCore 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pitasoft.Result.AspNetCore --version 1.0.5
                    
NuGet\Install-Package Pitasoft.Result.AspNetCore -Version 1.0.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="Pitasoft.Result.AspNetCore" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pitasoft.Result.AspNetCore" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Pitasoft.Result.AspNetCore" />
                    
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 Pitasoft.Result.AspNetCore --version 1.0.5
                    
#r "nuget: Pitasoft.Result.AspNetCore, 1.0.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 Pitasoft.Result.AspNetCore@1.0.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=Pitasoft.Result.AspNetCore&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Pitasoft.Result.AspNetCore&version=1.0.5
                    
Install as a Cake Tool

Pitasoft.Result.AspNetCore

Build Status NuGet version NuGet Downloads License Target Framework

English | Castellano


English

Pitasoft.Result.AspNetCore provides extension methods to integrate the Pitasoft.Result library with ASP.NET Core, allowing easy conversion of domain IResult objects into IActionResult and Minimal API IResult responses.

Installation

You can install the package via NuGet:

dotnet add package Pitasoft.Result.AspNetCore

Features

  • ToActionResult(): Converts a domain IResult into standard ASP.NET Core IActionResult responses (Ok, NotFound, Unauthorized, BadRequest, Conflict, etc.).
  • ToHttpResult(): Converts a domain IResult into standard ASP.NET Core Minimal API IResult responses.

Usage

In a Web API Controller

[ApiController]
[Route("api/[controller]")]
public class UsersController : ControllerBase
{
    private readonly IUserService _userService;

    public UsersController(IUserService userService)
    {
        _userService = userService;
    }

    [HttpGet("{id}")]
    public IActionResult GetUser(int id)
    {
        var result = _userService.GetUserById(id);
        return result.ToActionResult();
    }
}

In Minimal APIs

app.MapGet("/users/{id}", (int id, IUserService userService) =>
{
    var result = userService.GetUserById(id);
    return result.ToHttpResult();
});

License

This project is licensed under the terms described in the License.txt file.


Castellano

Pitasoft.Result.AspNetCore proporciona métodos de extensión para integrar la librería Pitasoft.Result con ASP.NET Core, permitiendo una conversión sencilla de objetos IResult de dominio en respuestas IActionResult e IResult de Minimal API.

Instalación

Puedes instalar el paquete a través de NuGet:

dotnet add package Pitasoft.Result.AspNetCore

Características

  • ToActionResult(): Convierte un IResult de dominio en respuestas estándar de ASP.NET Core IActionResult (Ok, NotFound, Unauthorized, BadRequest, Conflict, etc.).
  • ToHttpResult(): Convierte un IResult de dominio en respuestas estándar de Minimal API de ASP.NET Core (IResult).

Uso

En un Controlador de Web API

[ApiController]
[Route("api/[controller]")]
public class UsersController : ControllerBase
{
    private readonly IUserService _userService;

    public UsersController(IUserService userService)
    {
        _userService = userService;
    }

    [HttpGet("{id}")]
    public IActionResult GetUser(int id)
    {
        var result = _userService.GetUserById(id);
        return result.ToActionResult();
    }
}

En Minimal APIs

app.MapGet("/users/{id}", (int id, IUserService userService) =>
{
    var result = userService.GetUserById(id);
    return result.ToHttpResult();
});

Autor

Sebastián Martínez Pérez

License

Copyright © 2026 Pitasoft, S.L. Licensed under the LICENSE.txt provided in this repository.

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

Showing the top 2 NuGet packages that depend on Pitasoft.Result.AspNetCore:

Package Downloads
Pitasoft.FluentValidation.AspNetCore

ASP.NET Core integration for FluentValidation. Provides Minimal API endpoint filters and MVC action filters to validate request parameters using FluentValidation.IValidator<T> and returns Pitasoft.Result validation responses.

Pitasoft.Validation.AspNetCore

ASP.NET Core integration for Pitasoft.Validation. Provides Minimal API endpoint filters and MVC action filters to validate request parameters using IValidator<T>, IValidatorAsync<T>, IChecker<T>, and ICheckerAsync<T>.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.2 178 4/3/2026
2.1.1 158 4/2/2026
2.0.2 161 3/31/2026
2.0.1 110 3/30/2026
1.0.8 117 3/20/2026
1.0.7 119 3/10/2026
1.0.6 115 3/9/2026
1.0.5 114 3/6/2026
1.0.4 115 3/2/2026
1.0.3 125 2/25/2026
1.0.2 128 2/23/2026
1.0.1 124 2/23/2026