예제 #1
0
        public void CanWriteFormattedText()
        {
            string expected = "<ul>\n\t<li>\n\t\t1 + 2 = 3\n\t</li>\n</ul>";

            var writer = new SqlWriter();
            writer.AppendLine("<ul>");
                writer.Indent();
                    writer.AppendLine("<li>");
                        writer.Indent();
                            writer.AppendLine("1", "+", "2", "=", "3");
                        writer.Unindent();
                    writer.AppendLine("</li>");
                writer.Unindent();
            writer.AppendLine("</ul>");

            var result = writer.GetResult();
            Assert.AreEqual(expected, result);
        }
예제 #2
0
        public void Render(SqlWriter writer)
        {
            writer.AppendLine(SqlStrings.Select);

            writer.Indent();

            writer.AppendLine(Top);

            writer.AppendLine("*");

            writer.Unindent();

            writer.AppendLine(SqlStrings.From, "(");

            writer.Indent();

            writer.AppendLine(_innerSelect);

            writer.Unindent();

            writer.AppendLine(")", SqlStrings.As, _alias);

            writer.AppendLine(SqlStrings.Where, (BracketedName)SqlStrings.ROW_NUMBER, ">", _skip.ParamName);
        }
예제 #3
0
        public void Render(SqlWriter writer)
        {
            writer.AppendLine(SqlStrings.Select);

            writer.Indent();

            writer.AppendLine(Top);

            writer.AppendLine(Columns);

            writer.Unindent();

            writer.AppendLine(From);

            writer.AppendLine(JoinGroup);

            writer.AppendLine(Where);

            writer.AppendLine(OrderBy);
        }
예제 #4
0
 public void Render(SqlWriter writer)
 {
     writer.Append(Join, ReferenceMap.To.Table, SqlStrings.As, ToAlias, SqlStrings.NoLock);
     writer.Indent();
     writer.AppendLine(SqlStrings.On, FromAlias + ReferenceMap.Column, "=", ToAlias + ReferenceMap.To.Key.Column);
     writer.Unindent();
 }