24 lines
1,009 B
C#
24 lines
1,009 B
C#
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));
|
|
}
|
|
public static IConfigurationBuilder AddSmartConfig(this IConfigurationBuilder builder, Action<SmartConfigOptions> setupAction)
|
|
{
|
|
var options = new SmartConfigOptions();
|
|
setupAction(options);
|
|
|
|
return builder.AddProvider(new SmartConfigProvider(builder, options));
|
|
}
|
|
}
|
|
}
|