Пример #1
0
        private void ExecuteMigrationCode(string migrationFile)
        {
            //pull the whole code bits in - we're going to compile this to code
            //and execute it :):):):)
            string migrationCode = Files.GetFileText(migrationFile);

            //get the extension
            string        codeExtension = Path.GetExtension(migrationFile);
            ICodeLanguage codeLang      = new CSharpCodeLanguage();

            if (codeExtension.EndsWith(FileExtension.VB, StringComparison.InvariantCultureIgnoreCase))
            {
                codeLang = new VBCodeLanguage();
            }

            object[] parameters = new object[2];
            parameters[0] = providerName;
            parameters[1] = direction;
            CodeRunner.RunAndExecute(codeLang, migrationCode, "Migrate", parameters);
        }