.Net 6 has taken an approach that is considered more modern and simplistic, and they moved everything to the Program.cs file. While I haven't tried it in .Net 6, you should be able to do something like this in Program.cs
...
var app = builder.Build();
// Initialize the database
var scopeFactory = app.Services.GetRequiredService<IServiceScopeFactory>();
using (var scope = scopeFactory.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
if (context.Database.EnsureCreated())
{
SeedAbout.Initialize(context);
}
}
...
app.Run();
And the SeedAbout class would just be something like:
public class SeedAbout
{
public static void Initialize(ApplicationDbContext context)
{
var about = new AboutModel()
{
PageTitle = "About Me",
Title = "About",
Details = "Some general details..."
};
context.About.Add(about);
context.SaveChanges();
}
}
With that said, if you wanted an app to work the old way, they should still work. I believe you'll just need to setup your Program.cs and Startup.cs files in the previous manner, based off a previous template.