refactor: ConfigureWebApiExtensionsEnd entfernen und direkt in Program.cs konfigurieren
This commit is contained in:
@@ -22,6 +22,7 @@ using NSwag.Generation.Processors.Security;
|
||||
using NSwag;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) =>
|
||||
{
|
||||
@@ -117,7 +118,16 @@ try
|
||||
builder.Services.AddScoped<WebAppUserHelper>();
|
||||
builder.Services.AddJwtManagerWithLdap(configuration.GetSection("LdapOptions"));
|
||||
|
||||
builder.Services.ConfigureWebApiExtensionsEnd(); // should come last
|
||||
// should come last
|
||||
builder.Services.AddMvc()
|
||||
.ConfigureApiBehaviorOptions(options =>
|
||||
{
|
||||
options.InvalidModelStateResponseFactory = context =>
|
||||
{
|
||||
var errors = new HRD.WebApi.Helpers.HttpErrorDetails(context);
|
||||
return new BadRequestObjectResult(errors);
|
||||
};
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user