public string ToDfnSyntax() { StringBuilder sb = new StringBuilder(); sb.Append("query "); sb.Append(IsMulti ? "multi" : IsVoid ? "void" : "single"); sb.Append(" " + Name + " {\r\n"); if (IsStoredProc) { sb.Append(" storedproc;\r\n"); } if (IsStoredFunction) { sb.Append(" storedfunction;\r\n"); } if (IsPreUpgradeHook) { sb.Append(" pre-upgrade-hook;\r\n"); } sb.Append(Params.DfnSyntaxBlock(" params", true)); sb.Append(Results.DfnSyntaxBlock(" results", true)); sb.Append(" sql [" + Sql.Replace("[", "[[").Replace("]", "[]") + "];\r\n"); sb.Append(BeforeStatements.DfnSyntaxList(true)); sb.Append("};"); return(sb.ToString()); }
public string ToDfnSyntax() { StringBuilder sb = new StringBuilder(); sb.Append("table " + Name + " {\r\n"); if (ExistingName != null) { sb.Append(" existing as " + ExistingName + ";\r\n"); } foreach (string renamed in RenamedFrom) { sb.Append(" renamed from " + renamed + ";\r\n"); } sb.Append(Fields.DfnSyntaxBlock(" fields", true)); sb.Append(Gets.DfnSyntaxList(true)); sb.Append(References.DfnSyntaxList(true)); sb.Append(BeforeStatements.DfnSyntaxList(true)); sb.Append("};"); return(sb.ToString()); }