After creating the database migration script using Add-Migration script, we need to place this code in .Net 6 Program.cs file to apply the changes to database.
var app = builder.Build();
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
dbContext.Database.Migrate();
}