public static async Task Main(string[] args) { var host = CreateHostBuilder(args).Build(); using var scope = host.Services.CreateScope(); var services = scope.ServiceProvider; try { var context = services.GetRequiredService <DatabaseContext>(); await context.Database.MigrateAsync(); await SeedInit.SeedData(context); } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } await host.RunAsync(); }
protected override void Seed(Context context) { SeedInit.InitiateKnowledge(); }