refactor: Projektdateien migriert. Cloud-NuGet-Pakete durch lokale NuGet-Projekte ersetzt.

This commit is contained in:
Developer 02
2024-08-01 18:44:39 +02:00
parent 0d82f7af6f
commit 62ddd4873f
206 changed files with 10927 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
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 ConfigureWebApiExtensionsAtFirst(this IServiceCollection services)
{
//services.AddCors();
services.AddCustomCors("AllowAllOrigins");
services.Configure<IISOptions>(options =>
{
options.AuthenticationDisplayName = "Windows";
options.ForwardClientCertificate = true;
options.AutomaticAuthentication = true;
});
services.AddAuthentication(IISDefaults.AuthenticationScheme);
services.ConfigureJWT(Extends.JwtMiddlewareOptionsHelper.GetJwtMiddlewareOptions()); ;
services.ConfigureDAL(WebApiMiddlewareOptionsHelper.GetWebApiMiddlewareOptions());
services.AddSingleton<ILoggerManager, LoggerManager>();
services.ConfigureSwagger();
}
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);
};
});
}
}
}