in app/Program.cs [12:33]
public static void Main(string[] args)
{
var host = CreateHostBuilder(args).Build();
using (var scope = host.Services.CreateScope())
{
var services = scope.ServiceProvider;
var logger = services.GetRequiredService<ILogger<Program>>();
try
{
logger.LogInformation("Initialize Database ...");
DbHelper.Initialize(services);
logger.LogInformation("Database Initialized");
}
catch (Exception ex)
{
logger.LogError(ex, "An error occurred seeding the DB.");
}
}
host.Run();
}