2023-09-21 18:58:32 +02:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
2023-09-22 22:16:56 +02:00
|
|
|
|
namespace Insight.Agent.Extensions;
|
|
|
|
|
|
|
|
|
|
|
|
public static class ConfigurationExtensions
|
2023-09-21 18:58:32 +02:00
|
|
|
|
{
|
2023-09-22 22:16:56 +02:00
|
|
|
|
public static IConfigurationBuilder Defaults(this IConfigurationBuilder configuration)
|
2023-09-21 18:58:32 +02:00
|
|
|
|
{
|
2023-09-22 22:16:56 +02:00
|
|
|
|
configuration.Sources.Clear();
|
|
|
|
|
|
configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
|
|
|
|
|
return configuration.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true);
|
2023-09-21 18:58:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|