public static void Main(string[] args) { var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var service = scope.ServiceProvider.GetRequiredService <Context>(); SetupService.MigrateDatabase(service); } host.Run(); }
//public static void Main(string[] args) //{ // CreateHostBuilder(args).Build().Run(); //} public static void Main(string[] args) { var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var service = scope.ServiceProvider.GetRequiredService <TrainingContext>(); SetupService.MigrateDatabase(service); SetupService.SeedDatabase(service); //<- Zakomentarisano jer se puni preko sql scripte. NE KORISTIT! } host.Run(); }