Exemple #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
#pragma warning disable CS0618 // Typ oder Element ist veraltet
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, RaBeContext dbContext)
#pragma warning restore CS0618 // Typ oder Element ist veraltet
        {
            app.UseSession();
            app.UseCookiePolicy();
            app.UseCors();
            app.UseRewriter(new RewriteOptions().AddRedirect("^$", "/swagger"));

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            if (!env.IsDevelopment())
            {
                app.UseHttpsRedirection();
            }

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseOpenApi();
            app.UseSwaggerUi3();

            if (env.IsDevelopment())
            {
                IdentityModelEventSource.ShowPII = true;
            }

            app.UseMvc();

            // ===== Create tables ======
            dbContext.Database.EnsureCreated();
        }
Exemple #2
0
 public DBSaveChangesFilter(RaBeContext dbContext)
 {
     _dbContext = dbContext;
 }