Apio.Net
1.0.0
dotnet add package Apio.Net --version 1.0.0
NuGet\Install-Package Apio.Net -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="Apio.Net" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Apio.Net" Version="1.0.0" />
<PackageReference Include="Apio.Net" />
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 Apio.Net --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Apio.Net, 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 Apio.Net@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=Apio.Net&version=1.0.0
#tool nuget:?package=Apio.Net&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Apio.Net
Apio.Net es una biblioteca ligera, diseñada para simplificar el manejo de resultados y respuestas de API en aplicaciones .NET. Proporciona un enfoque consistente y tipo seguro para gestionar operaciones exitosas y errores, facilitando la creación de APIs robustas y fáciles de mantener. Con clases como Result<T> y métodos de extensión para IActionResult, Apio.Net te permite enfocarte en la lógica de negocio mientras maneja automáticamente la estructura de respuestas HTTP.
Características Principales
- Manejo de Resultados: Usa
Result<T>para representar operaciones exitosas o fallidas de manera explícita y tipo seguro. - Respuestas HTTP Consistentes: Convierte fácilmente
Result<T>enIActionResultcon métodos de extensión comoToActionResult. - Estructuras de Respuesta Predefinidas: Incluye clases como
ApiResponse<T>yApiErrorResponsepara respuestas HTTP bien formadas. - Inmutabilidad: Las propiedades de
Result<T>son inmutables, lo que garantiza un flujo de datos seguro y predecible. - Extensible: Fácil de integrar en proyectos existentes y compatible con ASP.NET Core y otros frameworks .NET.
Ejemplos de Uso
Ejemplo 1: Respuesta Exitosa
public async Task<IActionResult> CreateCity(CreateCityRequest request)
{
var result = await _cityService.AddCityAsync(request);
return result.ToActionResult();
}
###Ejemplo 1: Manejo de Errores
var errors = validationResult.Errors
.Select(e => new Error(e.PropertyName, e.ErrorMessage))
.ToImmutableArray();
return Result<CityDto>.CreateFailure(errors, HttpStatusCode.BadRequest);
###Ejemplo 2: Manejo de Errores
var errors = ImmutableArray.Create(new Error(
"Name",
$"City with name '{request.Name}' already exists."
));
return Result<CityDto>.CreateFailure(errors, HttpStatusCode.Conflict);
| Product | Versions 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 was computed. 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 was computed. 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.
-
net8.0
- Microsoft.AspNetCore.Mvc.Core (>= 2.3.0)
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 | 178 | 1/23/2025 |
1.0