Example #1
0
        public void SetConnectionString(string name, string value)
        {
            var appSettingsFile = new AppSettingsFile(AppSettingsFilePath);

            appSettingsFile.SetConnectionString(name, value);
            appSettingsFile.Commit();
        }
Example #2
0
        public void DeleteConnectionString(string name)
        {
            var settingsFile = new AppSettingsFile(AppSettingsFilePath);

            settingsFile.RemoveConnectionString(name);
            settingsFile.Commit();
        }
Example #3
0
        public void SetSecret(string name, string value)
        {
            var appSettingsFile = new AppSettingsFile(AppSettingsFilePath);

            appSettingsFile.SetSecret(name, value);
            appSettingsFile.Commit();
        }
Example #4
0
        public void DeleteSecret(string name)
        {
            var settingsFile = new AppSettingsFile(AppSettingsFilePath);

            settingsFile.RemoveSetting(name);
            settingsFile.Commit();
        }
        public void DeleteSecret(string name)
        {
            var settingsFile = new AppSettingsFile(Path.Combine(Environment.CurrentDirectory, AppSettingsFileName));

            settingsFile.RemoveSetting(name);
            settingsFile.Commit();
        }
Example #6
0
        public void SetConnectionString(string name, string value)
        {
            var appSettingsFile = new AppSettingsFile(AppSettingsFilePath);

            appSettingsFile.SetConnectionString(name, value, Constants.DefaultSqlProviderName);
            appSettingsFile.Commit();
        }
        public void SetConnectionString(string name, string value)
        {
            var appSettingsFile = new AppSettingsFile(Path.Combine(Environment.CurrentDirectory, AppSettingsFileName));

            appSettingsFile.SetConnectionString(name, value);
            appSettingsFile.Commit();
        }
Example #8
0
        public void DecryptSettings()
        {
            var settingsFile = new AppSettingsFile(AppSettingsFilePath);

            if (settingsFile.IsEncrypted)
            {
                var values            = settingsFile.GetValues();
                var connectionStrings = settingsFile.GetConnectionStrings();
                settingsFile.IsEncrypted = false;

                foreach (var pair in values)
                {
                    settingsFile.SetSecret(pair.Key, pair.Value);
                }

                foreach (var pair in connectionStrings)
                {
                    settingsFile.SetConnectionString(pair.Key, pair.Value);
                }

                settingsFile.Commit();
            }
        }
Example #9
0
        public void EncryptSettings()
        {
            var settingsFile = new AppSettingsFile(AppSettingsFilePath);

            if (!settingsFile.IsEncrypted)
            {
                var values            = settingsFile.GetValues();
                var connectionStrings = settingsFile.GetConnectionStrings();
                settingsFile.IsEncrypted = true;

                foreach (var pair in values)
                {
                    settingsFile.SetSecret(pair.Key, pair.Value);
                }

                foreach (var connectionString in connectionStrings)
                {
                    settingsFile.SetConnectionString(connectionString.Name, connectionString.Value, connectionString.ProviderName);
                }

                settingsFile.Commit();
            }
        }
        public void EncryptSettings()
        {
            var settingsFile = new AppSettingsFile(Path.Combine(Environment.CurrentDirectory, AppSettingsFileName));

            if (!settingsFile.IsEncrypted)
            {
                var values            = settingsFile.GetValues();
                var connectionStrings = settingsFile.GetConnectionStrings();
                settingsFile.IsEncrypted = true;

                foreach (var pair in values)
                {
                    settingsFile.SetSecret(pair.Key, pair.Value);
                }

                foreach (var pair in connectionStrings)
                {
                    settingsFile.SetConnectionString(pair.Key, pair.Value);
                }

                settingsFile.Commit();
            }
        }
Example #11
0
        public IDictionary <string, string> GetConnectionStrings()
        {
            var appSettingsFile = new AppSettingsFile(AppSettingsFilePath);

            return(appSettingsFile.GetConnectionStrings());
        }
Example #12
0
        public IDictionary <string, string> GetSecrets()
        {
            var appSettingsFile = new AppSettingsFile(AppSettingsFilePath);

            return(appSettingsFile.GetValues());
        }
Example #13
0
        public HostStartSettings GetHostStartSettings()
        {
            var settingsFile = new AppSettingsFile(AppSettingsFilePath);

            return(settingsFile.Host ?? new HostStartSettings());
        }
Example #14
0
        public IEnumerable <ConnectionString> GetConnectionStrings()
        {
            var appSettingsFile = new AppSettingsFile(AppSettingsFilePath);

            return(appSettingsFile.GetConnectionStrings());
        }
        public IDictionary <string, string> GetConnectionStrings()
        {
            var appSettingsFile = new AppSettingsFile(Path.Combine(Environment.CurrentDirectory, AppSettingsFileName));

            return(appSettingsFile.GetConnectionStrings());
        }