CaptchaMVC6Sample.Startup.Startup C# (CSharp) Method

Startup() public method

public Startup ( IHostingEnvironment env, IApplicationEnvironment appEnv ) : CaptchaMVC6Sample.Models
env IHostingEnvironment
appEnv IApplicationEnvironment
return CaptchaMVC6Sample.Models
        public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
        {
            // Setup configuration sources.

            var builder = new ConfigurationBuilder()
                .SetBasePath(appEnv.ApplicationBasePath)
                .AddJsonFile("config.json")
                .AddJsonFile($"config.{env.EnvironmentName}.json", optional: true);

            if (env.IsDevelopment())
            {
                // This reads the configuration keys from the secret store.
                // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
                builder.AddUserSecrets();
            }
            builder.AddEnvironmentVariables();
            Configuration = builder.Build();
        }