Jimmys20.ProblemDetails 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Jimmys20.ProblemDetails --version 1.0.3                
NuGet\Install-Package Jimmys20.ProblemDetails -Version 1.0.3                
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.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jimmys20.ProblemDetails --version 1.0.3                
#r "nuget: Jimmys20.ProblemDetails, 1.0.3"                
#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.3

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

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 net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.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