From bc04c2d36d95474c7a17fbb9669c393b78d3decf Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 5 Aug 2024 13:10:07 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20WebAppUserRepository=20und=20WebAppUser?= =?UTF-8?q?Helper=20als=20Scoped-Dienste=20zur=20Service-Collection=20hinz?= =?UTF-8?q?ugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DAL/DIExtensions.cs | 1 + StaffDBServer/Program.cs | 3 +++ .../_Shared/SharedControllers/WebAppUserController.cs | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DAL/DIExtensions.cs b/DAL/DIExtensions.cs index 94ec8e4..6488c8f 100644 --- a/DAL/DIExtensions.cs +++ b/DAL/DIExtensions.cs @@ -40,6 +40,7 @@ namespace DAL services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); return services; } diff --git a/StaffDBServer/Program.cs b/StaffDBServer/Program.cs index f691fe3..2694ceb 100644 --- a/StaffDBServer/Program.cs +++ b/StaffDBServer/Program.cs @@ -16,6 +16,7 @@ using System.Reflection; using HRD.LDAPService.JWT; using HRD.WebApi.DAL.Middleware; using HRD.WebApi.Helpers; +using StaffDBServer.SharedControllers; AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) => { @@ -54,6 +55,8 @@ try }); builder.Services.AddStaffDBRepositories(); + builder.Services.AddScoped(); + builder.Services.ConfigureWebApiExtensionsEnd(); // should come last var app = builder.Build(); diff --git a/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs b/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs index e7fa4c5..b150b1a 100644 --- a/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs +++ b/StaffDBServer/_Shared/SharedControllers/WebAppUserController.cs @@ -11,11 +11,11 @@ using System.Threading.Tasks; namespace StaffDBServer.SharedControllers { - [JWTAuthorizeAttribute] + [JWTAuthorize] public class WebAppUserController : BaseMiniController { private readonly WebAppUserRepository webAppUserRepository; - WebAppUserHelper webAppUserHelper; + private readonly WebAppUserHelper webAppUserHelper; public WebAppUserController(WebApiContext context, WebAppUserRepository webAppUserRepository, WebAppUserHelper webAppUserHelper) : base(context) {