Arc4u.AspNetCore.Results 8.3.2

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

Results

ProblemDetails

Implement extension methods for ProblemDetails to make it easier to create ProblemDetails instances.

ProblemDetails is a simple POCO object and this package adds a fluent Api to create one.

Classicaly we have

var problemDetails = new ProblemDetails
{
    Title = "Some title",
    Detail = "Some detail",
    Status = 400,
    Type = "Some type",
    Instance = "Instance"
}

When using the fluent Api we can write.

var problemDetails = new ProblemDetails()
                    .WithTitle("Some title")
                    .WithDetail("Some detail")
                    .WithStatusCode(StatusCodes.Status400BadRequest)
                    .WithType(new Uri("about:blank"))
                    .WithSeverity(Severity.Error.ToString());

The method WithType asks for a Uri to be sure that the type is referring to a url.

From Results to ProblemDetails

As it is a common scenario to return a ProblemDetails from an action, this package provides extension methods to convert the results to ProblemDetails.

Different scenarios are covered:

  • ToGenericMessage: Converts a result to a ProblemDetails with a generic message saying the information is logged.
  • ToProblemDetails: Converts a result to a ProblemDetails or a generic one if the errors contain at least one exception.

The developers will generaly not used the ToGenericMessage method, but it is used by the ToProblemDetails method, the ToProblemDetails method is taking care to manage this to a generic message if any exception(s) are part of the error messages collection.

A default Function implementation exists to convert an exception to a ProblemDetails, but it is possible to provide a custom implementation. Just use the static method 'SetFromErrorFactory(Func<IEnumerable<IError>, ProblemDetails> fromErrors)' to set your custom implementation.

The Arc4u framework covers the following Error types:

  • IExceptionalError ⇒ will result in a Generic message with an Http Status Code equal to 500.
  • ProblemDetailsError ⇒ will be converted to a ProblemDetails with a default Http Status Code equal to 400 if another one is not given!
  • ValidationError ⇒ will be converted to a ValidationProblemDetails with a Http Status Code equal to 422.

If you have your own error type, you can implement the IError interface and provide a custom implementation to convert it to a ProblemDetails.

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 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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Arc4u.AspNetCore.Results:

Package Downloads
Arc4u.Standard.OAuth2.AspNetCore

Package Description

Arc4u.OAuth2.AspNetCore

Package Description

Arc4u.OAuth2.AspNetCore.Blazor

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.0-preview23 85 3/19/2026
9.0.0-preview22 82 3/18/2026
9.0.0-preview21 100 3/8/2026
9.0.0-preview20 111 2/11/2026
9.0.0-preview19 137 2/5/2026
9.0.0-preview18 104 2/4/2026
9.0.0-preview17 107 2/3/2026
9.0.0-preview16 120 1/19/2026
9.0.0-preview15 316 12/17/2025
9.0.0-preview14 275 12/16/2025
9.0.0-preview13 284 12/16/2025
9.0.0-preview12 428 11/20/2025
9.0.0-preview11 406 11/17/2025
9.0.0-preview10 410 11/17/2025
9.0.0-preview09 305 11/12/2025
9.0.0-preview08 222 11/3/2025
9.0.0-preview07 209 11/2/2025
9.0.0-preview06 203 10/26/2025
9.0.0-preview05 121 10/3/2025
8.3.2 418 7/18/2025
Loading failed