Esempio n. 1
0
        static ConfigBase()
        {
            var builder = AwesomeMethods.CreateConfigurationBuilder("hosting");

            if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
            {
                builder.AddUserSecrets();
            }
            Configuration = builder.Build();
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                       .UseConfiguration(AwesomeMethods.CreateConfigurationBuilder("hosting").Build())
                       .UseKestrel()
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseStartup <Startup>()
                       .Build();

            host.Run();
        }
Esempio n. 3
0
        IConfigurationRoot LoadConfiguration(IHostingEnvironment env)
        {
            var builder = AwesomeMethods.CreateConfigurationBuilder("appsettings")
                          .AddEnvironmentVariables();

            if (env.IsDevelopment())
            {
                // In development environment we add user secrets
                builder.AddUserSecrets();
            }
            ;

            return(builder.Build());
        }
Esempio n. 4
0
 IConfigurationRoot LoadConfiguration(IHostingEnvironment env)
 {
     return(AwesomeMethods.CreateConfigurationBuilder("appsettings")
            .AddEnvironmentVariables()
            .Build());
 }