コード例 #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, EFDbContext dbContext, ILoggerFactory loggerFactory)
        {
            // Error handling
            app.UseMiddleware <ExceptionMiddleware>();

            // Logging
            loggerFactory.AddLog4Net();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();


            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute("default", "{controller=FileUpload}/{action=Index}");
            });

            //create Db if it not exist
            dbContext.DatabaseCheckCreate();
        }