Ejemplo n.º 1
0
        //public static void Main(string[] args)
        //{
        //    CreateWebHostBuilder(args).Build().Run();
        //}

        //public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        //    WebHost.CreateDefaultBuilder(args)
        //        .UseStartup<Startup>();
        public static void Main(string[] args)
        {
            var host = BuildWebHost(args);

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;



                var context = services.GetService <CoffeeMgtDbContext>();
                context.Database.Migrate();
                context.Database.EnsureCreated();
                DataSeeder.InitialSeed(context);
            }
            host.Run();
        }