// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public async void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, MyHealthDataInitializer dataInitializer) { // Add Application Insights monitoring to the request pipeline as a very first middleware. app.UseApplicationInsightsRequestTelemetry(); loggerFactory.AddConsole(); // Add the following to the request pipeline only in development environment. if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } // Add Application Insights exceptions handling to the request pipeline. app.UseApplicationInsightsExceptionTelemetry(); // Add static files to the request pipeline. app.UseStaticFiles(); app.UseSession(); app.ConfigureSecurity(); // Add MVC to the request pipeline. app.ConfigureRoutes(); await dataInitializer.InitializeDatabaseAsync(app.ApplicationServices); }
public TenantsRepository(IServiceProvider serviceProvider, MyHealthContext dbcontext, UserManager <ApplicationUser> userManager, MyHealthDataInitializer myHealthDataInitializer) { _context = dbcontext; _userManager = userManager; _myHealthDataInitializer = myHealthDataInitializer; _serviceProvider = serviceProvider; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, MyHealthDataInitializer databaseInitializer) { databaseInitializer.InitializeDatabaseAsync(app.ApplicationServices).Wait(); app.UseTestServerAuthentication(); app.UseExceptionHandler(builder => { builder.Run(context => { context.Response.StatusCode = 500; return(Task.FromResult(0)); }); }); app.UseMvc(); }
// Configure is called after ConfigureServices is called. public async void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, MyHealthDataInitializer dataInitializer) { loggerFactory.MinimumLevel = LogLevel.Information; loggerFactory.AddConsole(); loggerFactory.AddDebug(); // Configure the HTTP request pipeline. // Add the following to the request pipeline only in development environment. if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(options => options.EnableAll()); } else { // Add Error handling middleware which catches all application specific errors and // sends the request to the following path or controller action. app.UseExceptionHandler("/Home/Error"); } // Add the platform handler to the request pipeline. app.UseIISPlatformHandler(); // Add static files to the request pipeline. app.UseStaticFiles(); // Add MVC to the request pipeline. app.ConfigureRoutes(); await dataInitializer.InitializeDatabaseAsync(app.ApplicationServices, Configuration); }