/// <summary>
        /// Use Azure Key Vault
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="vaultUri"></param>
        /// <param name="azureAadClientId"></param>
        /// <param name="azureAadClientSecret"></param>
        /// <returns></returns>
        public static IConfigConfiguration UseAzureKeyVault(this IConfigConfiguration configuration,
                                                            Uri vaultUri, string azureAadClientId, string azureAadClientSecret)
        {
            configuration.AddStore(new AzureKeyVaultConfigStore(vaultUri, azureAadClientId, azureAadClientSecret));

            return(configuration);
        }
Esempio n. 2
0
        public static IConfigConfiguration UseStorageNetBlobs(this IConfigConfiguration configuration, IBlobStorageProvider blobs)
        {
            IConfigStore store = new BlobConfigStore(blobs);

            configuration.AddStore(store);

            return(configuration);
        }
Esempio n. 3
0
            protected override void OnConfigure(IConfigConfiguration configuration)
            {
                configuration.AddStore(_store);

                if (_customParser != null)
                {
                    configuration.AddParser(_customParser);
                }
            }
Esempio n. 4
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.AddStore(_store);
 }
Esempio n. 5
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.AddStore(_store);
     configuration.CacheTimeout = TimeSpan.Zero;
 }
 /// <summary>
 /// Uses JSON file as a configuration storage.
 /// </summary>
 /// <param name="configuration">Configuration object.</param>
 /// <param name="jsonFilePath">Full path to json storage file.</param>
 /// <returns>Changed configuration.</returns>
 /// <remarks>Storage file does not have to exist, however it will be created as soon as first write performed.</remarks>
 public static IConfigConfiguration UseJsonFile(this IConfigConfiguration configuration, string jsonFilePath)
 {
     configuration.AddStore(new JsonFileConfigStore(jsonFilePath));
     return(configuration);
 }
 /// <summary>
 /// Accepts configuration from the command line arguments. This is not intended to replace a command line parsing framework but rather
 /// complement it in a configuration like way. Uses current process' command line parameters automatically
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="positionToOption">When parameters are not named you can specify this dictionary to map parameter position to option value.</param>
 /// <returns>Changed configuration</returns>
 public static IConfigConfiguration UseCommandLineArgs(this IConfigConfiguration configuration, Dictionary <int, Option> positionToOption = null)
 {
     configuration.AddStore(new CommandLineConfigStore(null, positionToOption));
     return(configuration);
 }
 /// <summary>
 /// Use in-memory configuration
 /// </summary>
 /// <param name="configuration"></param>
 /// <returns></returns>
 public static IConfigConfiguration UseInMemoryConfig(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new InMemoryConfigStore());
     return(configuration);
 }
 /// <summary>
 /// Simple INI storage.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="iniFilePath">File does not have to exist, however it will be created as soon as you try to write to it.</param>
 /// <returns></returns>
 public static IConfigConfiguration UseIniFile(this IConfigConfiguration configuration, string iniFilePath)
 {
     configuration.AddStore(new IniFileConfigStore(iniFilePath));
     return(configuration);
 }
Esempio n. 10
0
 /// <summary>
 /// Uses system environment variables
 /// </summary>
 public static IConfigConfiguration UseEnvironmentVariables(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new EnvironmentVariablesStore());
     return(configuration);
 }
Esempio n. 11
0
 /// <summary>
 /// Reads configuration from the .dll.config or .exe.config file.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="assembly">Reference to the assembly to look for</param>
 /// <returns></returns>
 public static IConfigConfiguration UseAssemblyConfig(this IConfigConfiguration configuration, Assembly assembly)
 {
     configuration.AddStore(new AssemblyConfigStore(assembly));
     return(configuration);
 }
Esempio n. 12
0
 /// <summary>
 /// Standard app.config (web.config) configuration store. Read-only.
 /// </summary>
 public static IConfigConfiguration UseAppConfig(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new AppConfigStore());
     return(configuration);
 }
Esempio n. 13
0
 /// <summary>
 /// Use azure tables
 /// </summary>
 public static IConfigConfiguration UseAzureTable(this IConfigConfiguration configuration,
                                                  string accountName, string storageKey, string tableName, string appName)
 {
     configuration.AddStore(new AzureTableConfigStore(accountName, storageKey, tableName, appName));
     return(configuration);
 }
Esempio n. 14
0
 /// <summary>
 /// Accepts configuration from the command line arguments. This is not intended to replace a command line parsing framework but rather
 /// complement it in a configuration like way. Uses current process' command line parameters automatically
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <returns>Changed configuration</returns>
 public static IConfigConfiguration UseCommandLineArgs(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new CommandLineConfigStore(null));
     return(configuration);
 }
Esempio n. 15
0
 /// <summary>
 /// Accepts configuration from the command line arguments. This is not intended to replace a command line parsing framework but rather
 /// complement it in a configuration like way.
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="args">Parameters usually passed to the Main method. This argument is optional and when set to null will get process
 /// command line parameters automatically.</param>
 /// <returns>Chained configuration</returns>
 public static IConfigConfiguration UseCommandLineArgs(this IConfigConfiguration configuration, string[] args)
 {
     configuration.AddStore(new CommandLineConfigStore(args));
     return(configuration);
 }
Esempio n. 16
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.AddStore(_store);
     configuration.CacheTimeout = TimeSpan.Zero;
 }