Пример #1
0
        public string CreateEnvironmentSettingWithConnectionString(string settingName, string connectionString)
        {
            var a = settingName.Split('.');
            var setting = new EnvironmentSetting(a[0], a[1], a[2], connectionString);

            return setting.SettingName;
        }
        private static EnvironmentSetting CreateEnvironmentSetting()
        {
            _machineName = Environment.MachineName;
            _provider = "SqLite";
            _name = "Test";
            _connectionString = "Data Source=:memory:;Version=3;New=True;Pooling=True;Max Pool Size=1;";

            var env = new EnvironmentSetting(_machineName, _provider, _name, _connectionString);

            return env;
        }
Пример #3
0
        public string RegisterEnvironmentWithNameAndProviderWithConnectionString(string name, string provider, string connectionString)
        {
            if (GenFormApplication.GetRegisterdProviders().All(p => p.ProviderName != provider)) return string.Empty;

            var env = new EnvironmentSetting(Environment.MachineName, name, provider, connectionString);
            GenFormApplication.Environments.AddEnvironment(env);

            return env.SettingName;
        }