ResultToProblem 1.0.3
See the version list below for details.
dotnet add package ResultToProblem --version 1.0.3
NuGet\Install-Package ResultToProblem -Version 1.0.3
<PackageReference Include="ResultToProblem" Version="1.0.3" />
<PackageVersion Include="ResultToProblem" Version="1.0.3" />
<PackageReference Include="ResultToProblem" />
paket add ResultToProblem --version 1.0.3
#r "nuget: ResultToProblem, 1.0.3"
#:package ResultToProblem@1.0.3
#addin nuget:?package=ResultToProblem&version=1.0.3
#tool nuget:?package=ResultToProblem&version=1.0.3
ResultToProblem
https://www.nuget.org/packages/ResultToProblem/
ResultToProblem is a .NET library that extends the Result pattern and simplifies the conversion of domain results into standard HTTP responses using ProblemDetails.
Its purpose is to streamline error handling in ASP.NET Core applications, maintaining a clean and consistent style across endpoints and controllers.
Installation
Install the package from NuGet:
bash dotnet add package ResultToProblem
Usage
Examples in an ASP.NET Core project:
Minimal API endpoint using ResultToProblem:
program.cs:
using ResultToProblem.Domain.Common;
using ResultToProblem.Domain.Enums;
using ResultToProblem.Api.Extensions;
//....
app.MapGet("/", () =>
{
var random = new Random();
var temperature = random.Next(-10, 40);
if (temperature < -5)
{
var result = Result.Failure(
message: "Temperature sensor error",
code: "WEATHER_SENSOR_FAILURE",
type: ErrorType.Unexpected
);
return Results.Problem(result.ToProblemDetails());
}
var success = Result.Success($"Today's temperature is {temperature}°C");
return Results.Ok(success.Value);
});
app.Run();
✨ Features
- Automatically converts Result objects into ProblemDetails
- Standardized handling for common errors: NotFound, Validation, Conflict, Unexpected
- Easy-to-use extensions for minimal API endpoints
- Compatible with Clean Architecture and Domain-Driven Design
📦 Publishing
This project is distributed as a NuGet package.
To publish a new version:
bash dotnet build -c Release dotnet pack -c Release dotnet nuget push bin/Release/ResultToProblem.1.0.0.nupkg --api-key YOUR_API_KEY --source https://api.nuget.org/v3/index.json
⚖️ License
This project is freely available under the MIT license.
You may use, modify, and distribute it without restrictions, as long as you retain the reference to the original license.
| Product | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Http (>= 2.3.9)
- Microsoft.AspNetCore.OpenApi (>= 10.0.7)
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 |
|---|---|---|
| 2.0.7 | 148 | 6/14/2026 |
| 2.0.6 | 112 | 5/13/2026 |
| 2.0.5 | 105 | 5/13/2026 |
| 2.0.4 | 107 | 5/13/2026 |
| 2.0.3 | 107 | 5/13/2026 |
| 2.0.2 | 108 | 5/12/2026 |
| 2.0.1 | 107 | 5/12/2026 |
| 2.0.0 | 109 | 5/12/2026 |
| 1.0.9 | 117 | 5/12/2026 |
| 1.0.8 | 105 | 5/11/2026 |
| 1.0.7 | 116 | 5/11/2026 |
| 1.0.6 | 108 | 5/11/2026 |
| 1.0.5 | 103 | 5/11/2026 |
| 1.0.4 | 116 | 5/8/2026 |
| 1.0.3 | 122 | 5/8/2026 |
| 1.0.2 | 109 | 5/8/2026 |
| 1.0.1 | 108 | 5/8/2026 |
| 1.0.0 | 112 | 5/8/2026 |