Exemplo n.º 1
0
        public void Configure(IApplicationBuilder app)
        {
            
            var config = this.Configuration;
            var appConfig = new AppConfiguration();
            ConfigurationBinder.Bind(config, appConfig);

            app.UseOwin(x => x.UseNancy(opt => opt.Bootstrapper = new DemoBootstrapper(appConfig)));
        }
Exemplo n.º 2
0
 public DemoBootstrapper(AppConfiguration appConfig)
 {
     /*
     We could register appConfig as an instance in the container which can
     be injected into areas that need it or we could create our own INancyEnvironment
     extension and use that.
     */
     Console.WriteLine(appConfig.Smtp.Server);
     Console.WriteLine(appConfig.Smtp.User);
     Console.WriteLine(appConfig.Logging.IncludeScopes);
 }