Jimmys20.ProblemDetails 1.0.6

dotnet add package Jimmys20.ProblemDetails --version 1.0.6                
NuGet\Install-Package Jimmys20.ProblemDetails -Version 1.0.6                
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="Jimmys20.ProblemDetails" Version="1.0.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jimmys20.ProblemDetails --version 1.0.6                
#r "nuget: Jimmys20.ProblemDetails, 1.0.6"                
#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.
// Install Jimmys20.ProblemDetails as a Cake Addin
#addin nuget:?package=Jimmys20.ProblemDetails&version=1.0.6

// Install Jimmys20.ProblemDetails as a Cake Tool
#tool nuget:?package=Jimmys20.ProblemDetails&version=1.0.6                

ProblemDetails NuGet

Utility library for handling Problem Details error responses in .NET applications.

Installation

Install-Package Jimmys20.ProblemDetails

Usage

Blazor

Program.cs
...
using Jimmys20.ProblemDetails;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services.AddTransient<ProblemDetailsHandler>();

builder.Services
    .AddHttpClient("ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
    .AddHttpMessageHandler<ProblemDetailsHandler>();

builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("ServerAPI"));

await builder.Build().RunAsync();
_Imports.razor
...
@using Jimmys20.ProblemDetails
FetchData.razor
...

@code {
    private WeatherForecast[]? forecasts;
    
    protected override async Task OnInitializedAsync()
    {
        try
        {
            forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
        }
        catch (ProblemDetailsException ex)
        {
            var problem = ex.Problem;
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.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.6 79 11/15/2024
1.0.5 260 11/16/2023
1.0.4 346 1/13/2023
1.0.3 300 12/21/2022
1.0.2 419 8/1/2022
1.0.1 428 6/1/2022
1.0.0 414 6/1/2022