// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, InsuranceCompany11Context context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); // добавляем поддержку сессий app.UseSession(); // добавляем компонент miidleware по инициализации базы данных app.UseDbInitializer(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
public Task Invoke(HttpContext context, IServiceProvider serviceProvider, InsuranceCompany11Context dbContext) { if (!(context.Session.Keys.Contains("starting"))) { DbInitializer.Initialize(dbContext); context.Session.SetString("starting", "Yes"); } // Call the next delegate/middleware in the pipeline return(_next.Invoke(context)); }
public StaffsController(InsuranceCompany11Context context) { _context = context; }
public RisksController(InsuranceCompany11Context context) { _context = context; }
public ClientGroupsController(InsuranceCompany11Context context) { _context = context; }