public void SaveScript(SqlSyntax syntax, string path) { using (var file = File.CreateText(path)) { foreach (var cmd in syntax.DatabaseCommands(this)) { WriteCommand(syntax, file, cmd); EndBatch(syntax, file); } foreach (var t in Tables) { WriteCommands(syntax, file, t); } foreach (var fk in ForeignKeys) { WriteCommands(syntax, file, fk); } } }