public Startup(IHostingEnvironment env, IConfiguration configuration) { Configuration = configuration; //var conex = Configuration.GetConnectionString("DefaultPostgresConnection"); DbContextDataInitializer.Initialize(new PostgressDbContext(Configuration)); }
// 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); }
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()); }