diff --git a/GBase.Api/Communication/ServerProtocol.cs b/GBase.Api/Communication/ServerProtocol.cs index 24bd7c4..b395ec4 100644 --- a/GBase.Api/Communication/ServerProtocol.cs +++ b/GBase.Api/Communication/ServerProtocol.cs @@ -38,20 +38,14 @@ namespace GBase.Api.Communication /// The /// A protocol string for the /// Invalid protocol passed. - public static string GetProtocolString(this ServerProtocol protocol) - { - switch (protocol) + public static string GetProtocolString(this ServerProtocol protocol) => + protocol switch { - case ServerProtocol.Http: - return @"http://"; - case ServerProtocol.Https: - return @"https://"; - case ServerProtocol.Tcp: - return @"net.tcp://"; - default: - throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Invalid Protocol"); - } - } + ServerProtocol.Http => @"http://", + ServerProtocol.Https => @"https://", + ServerProtocol.Tcp => @"net.tcp://", + _ => throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Invalid Protocol") + }; /// /// Get the for a given