ylliX - Online Advertising Network

I can’t make ProblemDetails pattern working every time

Trying to investigate ProblemDetails and meet some issues. My code using Microsoft.AspNetCore.Builder; using WebApplication3; var builder = WebApplication.CreateBuilder(args); builder.Services.AddProblemDetails(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); app.UseStatusCodePages(); app.UseExceptionHandler(); app.MapGet(“/hello”, () => { throw new Exception(“Oulah. Hello API has problems!”); }); app.MapGet(“/bad”, () => Results.BadRequest(new { message = “Very bad, you have a problem.” })); app.Run(); As […]