I need to determine whether pooling was explicitly set on the base connection string. I thought I could do that by using NpgsqlConnectionStringBuilder.ContainsKey, however it always returns true.
Repro:
const string connectionString = "Server=localhost;Port=5432;Database=db;User Id=postgres;Password=postgres;";
var csBuilder = new NpgsqlConnectionStringBuilder(connectionString);
Console.WriteLine($"ContainsKey Pooling: {csBuilder.ContainsKey("Pooling")}");
Console.WriteLine("== Keys ==");
foreach (var builderKey in csBuilder.Keys)
{
Console.WriteLine(builderKey);
}
Output:
ContainsKey Pooling: True
== Keys ==
Host
Port
Database
Username
Password