23 lines
647 B
C#
23 lines
647 B
C#
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace Example.Data;
|
|
|
|
internal static class DesignTimeConfiguration
|
|
{
|
|
public static IConfiguration Create(bool includeDevelopmentSettings)
|
|
{
|
|
var builder = new ConfigurationBuilder()
|
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: false);
|
|
|
|
if (includeDevelopmentSettings)
|
|
{
|
|
builder.AddJsonFile("appsettings.Development.json", optional: false, reloadOnChange: false);
|
|
}
|
|
|
|
return builder
|
|
.AddEnvironmentVariables()
|
|
.Build();
|
|
}
|
|
}
|