Exemple #1
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseIpRateLimiting();

            app.UseStaticFiles();
            lifetime.ApplicationStarted.Register(UnRegService);
            GetContext.getInstance().ServiceProvider = app.ApplicationServices;
            getService();
            app.UseRouting();
            app.UseAuthorization();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Exemple #2
0
 private void getService()
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
     {
         var quartzStartup = (QuartzStartup)GetContext.getInstance().ServiceProvider.GetService(typeof(QuartzStartup));
         quartzStartup.rds.Clear();
     }
 }