refactor: ConfigureWebApiExtensionsEnd entfernen und direkt in Program.cs konfigurieren
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
using HRD.AppLogger;
|
||||
using HRD.LDAPService.JWT;
|
||||
using HRD.WebApi.DAL.Middleware;
|
||||
using HRD.WebApi.Helpers;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Server.IISIntegration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace StaffDBServer.SharedExtensions
|
||||
{
|
||||
public static class ServiceExtensions
|
||||
{
|
||||
public static void ConfigureWebApiExtensionsEnd(this IServiceCollection services)
|
||||
{
|
||||
services.AddMvc()
|
||||
.ConfigureApiBehaviorOptions(options =>
|
||||
{
|
||||
options.InvalidModelStateResponseFactory = context =>
|
||||
{
|
||||
var errors = new HRD.WebApi.Helpers.HttpErrorDetails(context);
|
||||
return new BadRequestObjectResult(errors);
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user