// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApplicationLifetime lifetime) { app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", AppName + "V1"); c.RoutePrefix = "help"; }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseStaticFiles() .UseRouting() .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapHub <EchoHub>("/echo"); }); lifetime.ApplicationStarted.Register(() => { TestAkka.Start(app, actorSystem); }); }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApplicationLifetime lifetime) { app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", AppName + "V1"); c.RoutePrefix = "help"; }); if (!env.IsProduction()) { using (var serviceScope = app.ApplicationServices.GetService <IServiceScopeFactory>().CreateScope()) { //로컬 개발모드에서는 Entity 자동생성 var userRepository = serviceScope.ServiceProvider.GetRequiredService <UserRepository>(); string currentConection = userRepository.Database.GetDbConnection().ConnectionString; if (currentConection.Contains("localhost")) { //userRepository.Database.EnsureDeleted(); //userRepository.Database.EnsureCreated(); } // ORM 마이그레이션은 다음을 참고합니다. // https://docs.microsoft.com/ko-kr/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli } app.UseDeveloperExceptionPage(); } app.UseStaticFiles() .UseRouting() .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapHub <EchoHub>("/echo"); }); lifetime.ApplicationStarted.Register(() => { TestAkka.Start(app, actorSystem); }); }