// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, SpiderLanguageContext spiderLanguageContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } spiderLanguageContext.Database.EnsureDeleted(); spiderLanguageContext.Database.EnsureCreated(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseNodeModules(env.ContentRootPath); app.UseMvc(routes => { routes.MapRoute( name: "SpiderLanguageRoute", template: "{controller}/{action}/{id?}", defaults: new { controller = "Home", action = "Index" }, constraints: new { id = "[0-9]+" }); }); }
public TeacherController(SpiderLanguageContext spiderLanguageContext) { _context = spiderLanguageContext; }
public HomeController(SpiderLanguageContext spiderLanguageContext, IWebHostEnvironment environment) { _context = spiderLanguageContext; _environment = environment; }