Esempio n. 1
0
        private static void DbUpdate(string[] args, NLogProvider logProvider)
        {
            var host          = Host.Find(AppDomain.CurrentDomain.BaseDirectory, logProvider);
            var configuration = host.RhetosRuntime
                                .BuildConfiguration(logProvider, host.ConfigurationFolder, configurationBuilder => configurationBuilder
                                                    .AddKeyValue(ConfigurationProvider.GetKey((ConfigurationProviderOptions o) => o.LegacyKeysWarning), true)
                                                    .AddKeyValue(ConfigurationProvider.GetKey((LoggingOptions o) => o.DelayedLogTimout), 60.0)
                                                    .AddConfigurationManagerConfiguration()
                                                    .AddCommandLineArgumentsWithConfigurationPaths(args));

            var deployment = new ApplicationDeployment(configuration, logProvider);

            deployment.UpdateDatabase();
            deployment.InitializeGeneratedApplication(host.RhetosRuntime);
            deployment.RestartWebServer(host.ConfigurationFolder);
        }