Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started work on configuration enhancements including local configurat…
…ion files, and the ability to insert additional configurations after the other typical configuration items
- Loading branch information
1 parent
676e712
commit 08b6c8f
Showing
11 changed files
with
272 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.Extensions.FileProviders; | ||
|
||
namespace Rocket.Surgery.Extensions.Configuration | ||
{ | ||
/// <summary> | ||
/// Options for configuring a hosting environment | ||
/// </summary> | ||
public class ConfigurationOptions | ||
{ | ||
/// <summary> | ||
/// Additional settings providers to be inserted after the default application settings file (typically appsettings.json) | ||
/// </summary> | ||
public List<SettingsConfigurationSourceProvider> SettingsConfigurationSourceProviders { get; } = new List<SettingsConfigurationSourceProvider>(); | ||
|
||
/// <summary> | ||
/// Additional settings providers to be inserted after the default environment application settings file (typically appsettings.{env}.json) | ||
/// </summary> | ||
public List<EnvironmentSettingsConfigurationSourceProvider> EnvironmentSettingsConfigurationSourceProviders { get; } = new List<EnvironmentSettingsConfigurationSourceProvider>(); | ||
|
||
/// <summary> | ||
/// Additional settings providers to be inserted after the environment application settings file and after the first local config file (typically appsettings.local.json) | ||
/// .local files are not generally checked into source control. | ||
/// </summary> | ||
public List<SettingsConfigurationSourceProvider> LocalSettingsConfigurationSourceProvider { get; } = new List<SettingsConfigurationSourceProvider>(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Configuration.Abstractions/EnvironmentSettingsConfigurationSourceProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.FileProviders; | ||
|
||
namespace Rocket.Surgery.Extensions.Configuration | ||
{ | ||
/// <summary> | ||
/// Returns a <see cref="IConfigurationSource"/> that may relate to the given file provider. | ||
/// This is inserted after appsettings.{env}.json | ||
/// </summary> | ||
public delegate IConfigurationSource EnvironmentSettingsConfigurationSourceProvider(IFileProvider fileProvider, string environmentName); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Configuration.Abstractions/SettingsConfigurationSourceProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.FileProviders; | ||
|
||
namespace Rocket.Surgery.Extensions.Configuration | ||
{ | ||
/// <summary> | ||
/// Returns a <see cref="IConfigurationSource"/> that may relate to the given file provider.!-- | ||
/// This is inserted after appsettings.json | ||
/// </summary> | ||
public delegate IConfigurationSource SettingsConfigurationSourceProvider(IFileProvider fileProvider); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.