internal static void ConfigureDatabaseMigrations(paymayAPIDbContext context) { //Check if there are any pending migrations if (context.Database.GetPendingMigrations().Any()) { context.Database.Migrate(); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, paymayAPIDbContext context) { Console.WriteLine("Current Environment"); Console.WriteLine(env.EnvironmentName); ConfigureSwagger(app); ConfigureMvc(app); ConfigureDatabaseMigrations(context); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); SeedDatabase(context); } }
internal static void SeedDatabase(paymayAPIDbContext context) { }