diff --git a/fundamentals/middleware/problem-details-service/Program.cs b/fundamentals/middleware/problem-details-service/Program.cs index 9eb34dc..d2ffc12 100644 --- a/fundamentals/middleware/problem-details-service/Program.cs +++ b/fundamentals/middleware/problem-details-service/Program.cs @@ -1,4 +1,4 @@ -#define API_CONTROLLER // MIDDLEWARE API_CONTROLLER API_CONT_SHORT DEFAULT +#define DISABLE // MIDDLEWARE API_CONTROLLER API_CONT_SHORT DEFAULT DISABLE #if NEVER #elif MIDDLEWARE // @@ -169,7 +169,6 @@ app.MapControllers(); app.Run(); // - #elif MIN_API // var builder = WebApplication.CreateBuilder(args); @@ -245,4 +244,24 @@ app.MapGet("/squareroot", (HttpContext context, double radicand) => app.Run(); // +#elif DISABLE +// +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllers() + .ConfigureApiBehaviorOptions(options => + { + options.SuppressMapClientErrors = true; + }); + +var app = builder.Build(); + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); +// #endif