Esempio n. 1
0
        public static void Main(string[] args)
        {
            var host = CreateHostBuilder(args).Build();

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;
                try
                {
                    var context =
                        services.GetRequiredService <Assignment_DDACContext>();
                    context.Database.Migrate();
                    SeedDataAdmin.Initialize(services);

                    ServiceBusController.Initialize();
                }
                catch (Exception ex)
                {
                    var logger =
                        services.GetRequiredService <ILogger <Program> >();
                    logger.LogError(ex, "An error occurred seeding theDB.");
                }
            }
            host.Run();
        }
        public static void Main(string[] args)
        {
            var host = CreateHostBuilder(args).Build();

            ServiceBusController.Initialize();
            host.Run();
        }