private void DumpScript(SqlScriptCompiler cmp, bool useTransaction) { cmp.PutCommonProlog(useTransaction, _model.SqlPrologBeforeBeginTransaction, _model.SqlPrologAfterBeginTransaction); foreach (var source in EnumSources()) { source.PutMaterialize(cmp); } foreach (var ent in Entities) { if (!ent.IncludeInSync) continue; ent.RunRound1(cmp, useTransaction); } var reverted = new List<TargetEntitySqlModel>(Entities); reverted.Reverse(); foreach (var ent in reverted) { if (!ent.IncludeInSync) continue; ent.RunRound2Reverted(cmp, useTransaction); } foreach (var source in EnumSources()) { source.PutDropMaterialized(cmp); } cmp.PutCommonEpilog(useTransaction, _model.SqlEpilogBeforeCommitTransaction, _model.SqlEpilogAfterCommitTransaction); }