Наследование: Expression
Пример #1
0
        public void SimpleCase(SqlFragment parent, SimpleCase simpleCase)
        {
            this.Script.OpenParen().Append(TSqlKeyword.CASE);
            this.Script.AppendFragment(simpleCase.Expression, simpleCase, this);
            this.Script.AppendLine();

            foreach (var condition in simpleCase.Conditions)
            {
                this.Script.Append(TSqlKeyword.WHEN);
                this.Script.AppendFragment(condition.WhenValue, simpleCase, this);
                this.Script.Append(TSqlKeyword.THEN);
                this.Script.AppendFragment(condition.ThenValue, simpleCase, this);
                this.Script.AppendLine();
            }

            if (simpleCase.ElseResultExpression != null)
            {
                this.Script.Append(TSqlKeyword.ELSE);
                this.Script.AppendFragment(simpleCase.ElseResultExpression, simpleCase, this);
                this.Script.AppendLine();
            }
            this.Script.Append(TSqlKeyword.END).CloseParen();
        }