public void GenerateSQL(string expression) { string code = expression; CompilerResults compilerResults = CompileCode(code); if (compilerResults.Errors.HasErrors) { MessageBox.Show("Expression has a syntax error."); return; } Assembly assembly = compilerResults.CompiledAssembly; foreach (TypeInfo definedType in assembly.DefinedTypes) { object instance = Activator.CreateInstance(definedType); string IdName = definedType.Name + "Id"; string schema = instance.CreateSchema(new GenerateProperties(idName: IdName)); SqlServerTextBox.AppendText(schema); } }
private void GenerateButton_Click(object sender, RoutedEventArgs e) { SqlServerTextBox.Clear(); GenerateSQL(CSharpTextBox.Text); }