示例#1
0
        public static void Initialize(VegaConfig config)
        {
            if (Instance == null)
            {
                Instance = config;
            }

            Instance.DataConnectionString = BuildConnectionString(Instance);

            return;
        }
示例#2
0
        private static String BuildConnectionString(VegaConfig config)
        {
            NpgsqlConnectionStringBuilder builder = new NpgsqlConnectionStringBuilder
            {
                Host        = config.DataHostname,
                Port        = config.DataPort,
                Username    = config.DataUsername,
                Password    = config.DataPassword,
                Database    = config.DataDatabase,
                Pooling     = true,
                MaxPoolSize = 500
            };

            return(builder.ToString());
        }