From f614e434f8c5173ed92e7f9cb34f9b24023b86eb Mon Sep 17 00:00:00 2001 From: Mathias Stenbom Date: Tue, 26 Nov 2024 11:13:27 +0100 Subject: [PATCH] Cleanup of NpgsqlConnectionStringBuilderWorkaround --- ...NpgsqlConnectionStringBuilderWorkaround.cs | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 Hangfire.Configuration/Internals/NpgsqlConnectionStringBuilderWorkaround.cs diff --git a/Hangfire.Configuration/Internals/NpgsqlConnectionStringBuilderWorkaround.cs b/Hangfire.Configuration/Internals/NpgsqlConnectionStringBuilderWorkaround.cs deleted file mode 100644 index 3ad85e8..0000000 --- a/Hangfire.Configuration/Internals/NpgsqlConnectionStringBuilderWorkaround.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using Npgsql; - -namespace Hangfire.Configuration.Internals; - -// Setting IntegratedSecurity property may throw if the environment this runs on is linux -internal static class NpgsqlConnectionStringBuilderWorkaround -{ - public static string SetIntegratedSecurity(string connectionString) - { - return connectionString + ";Integrated Security=True"; - } - - public static NpgsqlConnectionStringBuilder Parse(string connectionString) - { - try - { - return new NpgsqlConnectionStringBuilder(connectionString); - } - //System.ArgumentException : Format of the initialization string does not conform to specification starting at index 0. - //System.ArgumentException : Couldn't set integrated security - catch (ArgumentException e) - { - if (e.Message.Contains("Couldn't set integrated security")) - { - connectionString = connectionString.Replace("Integrated Security=true", ""); - return new NpgsqlConnectionStringBuilder(connectionString); - } - return new NpgsqlConnectionStringBuilder(connectionString); - } - } -} \ No newline at end of file