コード例 #1
0
        // 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]+" });
            });
        }
コード例 #2
0
 public TeacherController(SpiderLanguageContext spiderLanguageContext)
 {
     _context = spiderLanguageContext;
 }
コード例 #3
0
 public HomeController(SpiderLanguageContext spiderLanguageContext, IWebHostEnvironment environment)
 {
     _context     = spiderLanguageContext;
     _environment = environment;
 }