public static string ToPgsqlConnectionString(this DBSettings dbSettings)
        {
            var builder = new NpgsqlConnectionStringBuilder
            {
                Username               = dbSettings.DBUserName,
                Host                   = dbSettings.Server,
                Password               = dbSettings.DBPassword,
                Database               = dbSettings.Database,
                CommandTimeout         = 200,
                ConnectionIdleLifetime = 30,
                Pooling                = true,
                KeepAlive              = 30,
                TcpKeepAlive           = true
            };

            if (dbSettings.Port != null)
            {
                builder.Port = dbSettings.Port.Value;
            }

            return(builder.ToString());
        }
 public DbConnectionSettings(DBSettings dbSettings)
 {
     _dbSettings = dbSettings;
 }