예제 #1
0
        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();
        }
예제 #2
0
 protected override void Seed(Context context)
 {
     SeedInit.InitiateKnowledge();
 }