Пример #1
0
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(env.ContentRootPath)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

            builder.AddEnvironmentVariables();
            Conf = builder.Build();
            DatabaseManager.Instance.SqlConnectionString = Conf.GetConnectionString("DefaultConnection");
            databaseName = Conf.GetSection("ConnectionStrings").GetValue <string>("DefaultConnection");
        }