Exemplo n.º 1
0
        public void FullInstallTest()
        {
            // Change context connection string to test
            ContextManager.Instance.ConnectionString = Jhu.Graywulf.Test.AppSettings.RegistryTestConnectionString;

            var dbi = new DBInstaller();

            dbi.DropDatabase(true);

            dbi.CreateDatabase();

            dbi.CreateSchema();

            using (var context = ContextManager.Instance.CreateContext(ConnectionMode.AutoOpen, TransactionMode.AutoCommit))
            {
                // Create a cluster
                var ci = new ClusterInstaller(context);
                var cluster = ci.Install();

                // Create a federation
                var fi = new FederationInstaller(cluster);
                var federation = fi.Install();
            }

            //dbi.DropDatabase(true);
        }
Exemplo n.º 2
0
        public override void Run()
        {
            base.Run();

            try
            {
                Console.Write("Creating database... ");

                var i = new DBInstaller();
                i.CreateDatabase();
                i.CreateSchema();

                Console.WriteLine("done.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("failed.");

                Console.WriteLine(ex.Message);
            }
        }