Example #1
0
        public static void Main(string[] args)
        {
            var host = CreateWebHostBuilder(args).Build();

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;
                try
                {
                    var context = services.GetRequiredService <BrokenAPIContext>();
                    context.Database.Migrate();
                    SeedCategory.Initialize(services);
                    SeedError.Initialize(services);
                }
                catch
                {
                }
            }

            host.Run();
        }