From 090eead4fbaf2aee5dd3b8c3e61fc247a1f3d4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Emma=20=C2=ABMetal-Mighty=C2=BB=20Barlow?= <> Date: Thu, 30 May 2024 14:53:14 +0200 Subject: [PATCH] Rename extension methods --- .../Extensions/UpstreamProtocolExtensions.cs | 4 ++-- .../LoRaWan.NetworkServer/NetworkServerConfiguration.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/Extensions/UpstreamProtocolExtensions.cs b/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/Extensions/UpstreamProtocolExtensions.cs index 7afb353c31..5011575853 100644 --- a/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/Extensions/UpstreamProtocolExtensions.cs +++ b/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/Extensions/UpstreamProtocolExtensions.cs @@ -8,7 +8,7 @@ namespace LoRaWan.NetworkServer.Extensions; public static class UpstreamProtocolExtensions { - public static UpstreamProtocol StringToUpstreamProtocol(this string value) + public static UpstreamProtocol ToUpstreamProtocol(this string value) { return Enum.TryParse(value, true, out UpstreamProtocol upstreamProtocol) ? throw new ArgumentOutOfRangeException(nameof(value), value, @@ -16,7 +16,7 @@ public static UpstreamProtocol StringToUpstreamProtocol(this string value) : upstreamProtocol; } - public static TransportType UpstreamProtocolToTransportType(this UpstreamProtocol value) + public static TransportType ToTransportType(this UpstreamProtocol value) { return value switch { diff --git a/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/NetworkServerConfiguration.cs b/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/NetworkServerConfiguration.cs index b1905cf8f8..9daaea03eb 100644 --- a/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/NetworkServerConfiguration.cs +++ b/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoRaWan.NetworkServer/NetworkServerConfiguration.cs @@ -216,8 +216,8 @@ public static NetworkServerConfiguration CreateFromEnvironmentVariables() : throw new NotSupportedException($"'IOTHUB_CONNECTION_POOL_SIZE' needs to be between 1 and {AmqpConnectionPoolSettings.AbsoluteMaxPoolSize}."); config.UpstreamProtocol = envVars.GetEnvVar("UPSTREAM_PROTOCOL", "Amqp") - .StringToUpstreamProtocol() - .UpstreamProtocolToTransportType(); + .ToUpstreamProtocol() + .ToTransportType(); config.RedisConnectionString = envVars.GetEnvVar("REDIS_CONNECTION_STRING", string.Empty); if (!config.RunningAsIoTEdgeModule && !config.IsLocalDevelopment && string.IsNullOrEmpty(config.RedisConnectionString))