예제 #1
0
        private void Recompile(string directory)
        {
            var             testMessages  = new List <string>();
            Action <string> testLogAction = (string x) => testMessages.Add(x);

            var sourceDirectoryInfo = new DirectoryInfo(directory);
            var compiler            = new SchemaRecompiler(sourceDirectoryInfo, destinationDatabaseServer, testLogAction);

            compiler.RecompileExecutableObjects(false, true, false);
        }
예제 #2
0
        public void DoSqlRecompilerAction(DirectoryInfo scriptDirectory, bool dropDbExecutableObjects, bool retryCompiles, bool dropConstraints)
        {
            // Must have SourceDirectory, the directory must exist
            ErrorHelper.AssertPreCondition(Directory.Exists(scriptDirectory.FullName), string.Format("source-directory \"{0}\" was not found.", scriptDirectory.FullName));

            using (var destServer = (new SqlServer(_webAppInstallerConfig.DbServerName, _webAppInstallerConfig.DbName)))
            {
                var sqlRecompiler = new SchemaRecompiler(scriptDirectory, destServer, _loggingFunction);
                sqlRecompiler.RecompileExecutableObjects(dropDbExecutableObjects, retryCompiles, dropConstraints);
            }
        }