示例#1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAttendeeClient c)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

//            logger.LogInformation(string.Join("\n", Configuration.AsEnumerable().Select(item => $"{item.Key}: {item.Value}")));

            app.UseFileServer(); // serve static content from wwwroot

            // enable actuators middleware
            app.UseCloudFoundryActuators(MediaTypeVersion.V2, ActuatorContext.ActuatorAndCloudFoundry);
            app.UseEnvActuator();
            app.UseRefreshActuator();
            app.UseDbMigrationsActuator();
            app.UseDiscoveryClient();
            app.UseAtteendeeClient();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
 public HomeController(
     IAttendeeClient attendeeClient,
     ILogger <HomeController> log,
     IOptionsSnapshot <CloudFoundryApplicationOptions> app, Lazy <RepositoryProvider> provider)
 {
     _attendeeClient = attendeeClient;
     _log            = log;
     _app            = app;
     _provider       = provider;
 }
 public HomeController(
     IAttendeeClient attendeeClient,
     ILogger <HomeController> log,
     IOptionsSnapshot <CloudFoundryApplicationOptions> app,
     Lazy <RepositoryProvider> provider,
     IConfiguration config,
     AppState appState)
 {
     _attendeeClient = attendeeClient;
     _log            = log;
     _app            = app;
     _provider       = provider;
     _config         = config;
     _appState       = appState;
 }