I'm rewriting a simple application that uses Asp.NET 5. but now I'm using Asp.NET 6 for the new version of my app. Quick question: what's the replacement of database auto migration (like below in .NET5) in .NET6 or What approach should I use for automatic migration after application launch in .NET6?
Sample in .NET5:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PgSqlDbContext context)
{
context.Database.Migrate();
/*
other middlewares
*/
}
.NET6 :
var app = builder.Build();
// ???? for auto migration
// other middlewares