fix: Cache JsonSerializerOptions for NordigenHttpClient

This reduces execution time and memory allocation for GetRequiredService<INordigenClient>() by an order of magnitude
This commit is contained in:
Valters Melnalksnis
2022-06-24 16:28:44 +03:00
parent 25951fd00b
commit 66cbcbea2f
3 changed files with 31 additions and 11 deletions
@@ -73,6 +73,7 @@ public static class ServiceCollectionExtensions
return serviceCollection
.AddSingleton<NordigenTokenCache>()
.AddSingleton<NordigenJsonSerializerOptions>()
.AddTransient<INordigenClient, NordigenClient>()
.AddTransient<IAccountClient, AccountClient>()
.AddTransient<IAgreementClient, AgreementClient>()