예제 #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, IExceptionLoggingService _exceptionLoggingService)
        {
            app.UseExceptionHandler("/error");

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthentication();

            app.UseAuthorization();

            app.UseEndpoints(endpoints => { endpoints.MapControllers(); });

            using (var scope = app.ApplicationServices.GetRequiredService <IServiceScopeFactory>().CreateScope())
            {
                scope.ServiceProvider.GetService <GameMarketDbContext>().Database.Migrate();
                scope.ServiceProvider.GetService <GameMarketDbContext>().Database.EnsureCreated();
            }

            _exceptionLoggingService.Connect();
        }
 public ExceptionHandlingService(IExceptionLoggingService logger, IExceptionConfigurationService exceptionHandlerConfigurationService)
 {
     _logger = logger;
     _excpetionConfigurationService = exceptionHandlerConfigurationService;
 }
예제 #3
0
 public ErrorController(IExceptionLoggingService exceptionLoggingService)
 {
     _exceptionLoggingService = exceptionLoggingService;
 }