Esempio n. 1
0
        public Startup(IHostingEnvironment env, IConfiguration configuration)
        {
            Configuration = configuration;

            //var conex = Configuration.GetConnectionString("DefaultPostgresConnection");

            DbContextDataInitializer.Initialize(new PostgressDbContext(Configuration));
        }
Esempio n. 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserManager <AppUser> userManager)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();
            app.UseRouting();

            app.UseCors("CorsPolicy");

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

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

            DbContextDataInitializer.EnsureSeeded(userManager);
        }
Esempio n. 3
0
        public Startup(IHostingEnvironment env, IConfiguration configuration)
        {
            Configuration = configuration;

            DbContextDataInitializer.Initialize(new SqlServerDbContext(Configuration));
        }
        public Startup(IHostingEnvironment env, IConfiguration configuration)
        {
            Configuration = configuration;

            DbContextDataInitializer.Initialize(new InMemoryDbContext());
        }