From f50c12ab428ce461c2853bcc271622305c870a22 Mon Sep 17 00:00:00 2001 From: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:59:43 +0200 Subject: [PATCH] Fix #2942 - Add LoraWan service dependency before adding the http client. (#2943) --- .../Startup/IServiceCollectionExtension.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AzureIoTHub.Portal.Infrastructure/Startup/IServiceCollectionExtension.cs b/src/AzureIoTHub.Portal.Infrastructure/Startup/IServiceCollectionExtension.cs index 57c2cf988..cdb8abb56 100644 --- a/src/AzureIoTHub.Portal.Infrastructure/Startup/IServiceCollectionExtension.cs +++ b/src/AzureIoTHub.Portal.Infrastructure/Startup/IServiceCollectionExtension.cs @@ -69,6 +69,8 @@ private static IServiceCollection AddLoRaWanSupport(this IServiceCollection serv return services; } + _ = services.AddTransient(); + var transientHttpErrorPolicy = HttpPolicyExtensions .HandleTransientHttpError() .OrResult(c => c.StatusCode == HttpStatusCode.NotFound) @@ -179,7 +181,7 @@ private static IServiceCollection ConfigureMappers(this IServiceCollection servi private static IServiceCollection ConfigureServices(this IServiceCollection services) { - return services.AddTransient(); + return services; } private static IServiceCollection ConfigureHealthCheck(this IServiceCollection services)