Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Log.Logger = LogConfigurationHelper.GetConfiguration();

            try
            {
                var host          = BuildWebHost(args);
                var environment   = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
                var isDevelopment = environment == EnvironmentName.Development;
                if (isDevelopment)
                {
                    using (var scope = host.Services.CreateScope())
                    {
                        var services = scope.ServiceProvider;
                        DbInitializer.InitializeAsync(services).Wait();
                    }
                }
                host.Run();
            }
            catch (Exception ex)
            {
                Log.Fatal(ex, "Host terminated unexpectedly");
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            Log.Logger = LogConfigurationHelper.GetConfiguration();

            try
            {
                if (args.Length > 0 && args[0] == "--update-sizes")
                {
                    new SizeUpdater().Run();
                }
                else if (args.Length > 0 && args[0] == "--pbdt-import")
                {
                    new PbdtXlsxToSql().Run(@"D:\Documents", "22. SEMARANG", "33.22");
                }
                else if (args.Length > 0 && args[0] == "--pbdt-to-sdcontent")
                {
                    new PbdtToSdContent().run("33.22.20.2009", "2015");
                }
                else if (args.Length > 0 && args[0] == "--fix-duplicates")
                {
                    new DuplicateFixer().Run();
                }
                else if (args.Length > 0 && args[0] == "--fix-30-34")
                {
                    new Column3034Fixer().Run();
                }
                else
                {
                    var host = BuildWebHost(args);
                    host.Run();
                }
            }
            catch (Exception ex)
            {
                Log.Fatal(ex, "Host terminated unexpectedly");
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }