Skip to content

Commit

Permalink
transient and add httpclient for request (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
simen-rekkedal authored Sep 19, 2024
1 parent 48f1d22 commit 5282eb8
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,23 @@ public static IServiceCollection AddIntegrationLayer(this IServiceCollection ser
//Providers and supporting services
if (isDevelopment)
{
services.AddSingleton<IKeyVaultService, LocalKeyVaultService>();
services.AddTransient<IKeyVaultService, LocalKeyVaultService>();
}
else
{
services.AddSingleton<IKeyVaultService, KeyVaultService>();
services.AddTransient<IKeyVaultService, KeyVaultService>();
}

services.AddSingleton<IAccessTokenGenerator, AccessTokenGenerator>();
services.AddSingleton<IAccessTokenProvider, AccessTokenProvider>();
services.AddTransient<IAccessTokenGenerator, AccessTokenGenerator>();
services.AddTransient<IAccessTokenProvider, AccessTokenProvider>();


//Clients for the actual Features' Services
services.AddHttpClient<ISystemUserClient, SystemUserClient>();
services.AddHttpClient<ISystemRegisterClient, SystemRegisterClient>();
services.AddHttpClient<IAccessManagementClient, AccessManagementClient>();
services.AddHttpClient<IResourceRegistryClient, ResourceRegistryClient>();
services.AddHttpClient<IRequestClient, RequestClient>();

return services;
}
Expand All @@ -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<IUserProfileService, UserProfileService>();
services.AddSingleton<IPartyService, PartyService>();
services.AddTransient<IUserProfileService, UserProfileService>();
services.AddTransient<IPartyService, PartyService>();

//Altinn actual Features' Services
services.AddSingleton<ISystemUserService, SystemUserService>();
services.AddSingleton<ISystemRegisterService, SystemRegisterService>();
services.AddSingleton<IRequestService, RequestService>();
services.AddTransient<ISystemUserService, SystemUserService>();
services.AddTransient<ISystemRegisterService, SystemRegisterService>();
services.AddTransient<IRequestService, RequestService>();
services.AddHttpClient<IAccessManagementClient, AccessManagementClient>();
services.AddHttpClient<IRegisterClient, RegisterClient>();
services.AddHttpClient<IRequestClient, RequestClient>();
Expand Down

0 comments on commit 5282eb8

Please sign in to comment.