From 5282eb82fb8abcf07ca2b5c6440fbd8e49650cf6 Mon Sep 17 00:00:00 2001 From: Simen Rekkedal <61084786+simen-rekkedal@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:59:24 +0200 Subject: [PATCH] transient and add httpclient for request (#379) --- ...gramConfigurationAndDependencyInjection.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Extensions/ProgramConfigurationAndDependencyInjection.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Extensions/ProgramConfigurationAndDependencyInjection.cs index b52d8b39..e231641a 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Extensions/ProgramConfigurationAndDependencyInjection.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Extensions/ProgramConfigurationAndDependencyInjection.cs @@ -131,15 +131,15 @@ public static IServiceCollection AddIntegrationLayer(this IServiceCollection ser //Providers and supporting services if (isDevelopment) { - services.AddSingleton(); + services.AddTransient(); } else { - services.AddSingleton(); + services.AddTransient(); } - services.AddSingleton(); - services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); //Clients for the actual Features' Services @@ -147,6 +147,7 @@ public static IServiceCollection AddIntegrationLayer(this IServiceCollection ser services.AddHttpClient(); services.AddHttpClient(); services.AddHttpClient(); + services.AddHttpClient(); return services; } @@ -160,13 +161,13 @@ public static IServiceCollection AddIntegrationLayer(this IServiceCollection ser public static IServiceCollection AddCoreServices(this IServiceCollection services) { //Services for the login user and auth logic - services.AddSingleton(); - services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); //Altinn actual Features' Services - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddHttpClient(); services.AddHttpClient(); services.AddHttpClient();