Exemplo n.º 1
0
        // 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?}");
            });
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 public StaffsController(InsuranceCompany11Context context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public RisksController(InsuranceCompany11Context context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public ClientGroupsController(InsuranceCompany11Context context)
 {
     _context = context;
 }