Finalizes ConfigurationBuilder with indexer
This commit is contained in:
parent
1f675498a2
commit
6839cd82e2
5 changed files with 43 additions and 11 deletions
|
|
@ -8,6 +8,13 @@ namespace Core.Configurations.SmartConfig
|
|||
{
|
||||
public static class SmartConfigExtension
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="builder"></param>
|
||||
/// <param name="configKey">Name of key</param>
|
||||
/// <param name="path">If this is different than the default ConnectionStrings-element, then configure it.</param>
|
||||
/// <returns></returns>
|
||||
public static IConfigurationBuilder AddSmartConfig(this IConfigurationBuilder builder, string configKey = "DefaultConnection", string path = null)
|
||||
{
|
||||
return builder.AddProvider(new SmartConfigProvider(builder, configKey, path));
|
||||
|
|
@ -83,7 +90,7 @@ namespace Core.Configurations.SmartConfig
|
|||
var pairs = configs.Select(x => new KeyValuePair<string, JToken>(x.Key, JToken.Parse(x.Value.ToString())));
|
||||
|
||||
_configuration = Common.KeyValueToJson.Convert(pairs);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Newtonsoft.Json.Linq.JObject Configuration()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue