Esempio n. 1
0
        public override void AppendSql(StringBuilder builder, GeneratorContext filterParams)
        {
            if (IsValue)
            {
                builder.Append(Value);
            }
            else
            {
                if (!_skipBrackets)
                {
                    builder.Append(Dialect.OpenBracket);
                }

                _left.AppendSql(builder, filterParams);

                builder.Append(
                    _expression.NodeType switch
                {
                    ExpressionType.AndAlso => " " + Dialect.LogicalAnd + " ",
                    ExpressionType.OrElse => " " + Dialect.LogicalOr + " ",
                    ExpressionType.Equal => " " + Dialect.LogicalEquals + " ",
                    ExpressionType.NotEqual => " " + Dialect.LogicalNotEquals + " ",
                    ExpressionType.GreaterThan => " " + Dialect.LogicalGreater + " ",
                    ExpressionType.GreaterThanOrEqual => " " + Dialect.LogicalGreaterEquals + " ",
                    ExpressionType.LessThan => " " + Dialect.LogicalLess + " ",
                    ExpressionType.LessThanOrEqual => " " + Dialect.LogicalLessEquals + " ",
                    ExpressionType.Add => " " + Dialect.PlusSign + " ",
                    ExpressionType.AddChecked => " " + Dialect.PlusSign + " ",
                    ExpressionType.Subtract => " " + Dialect.MinusSign + " ",
                    ExpressionType.SubtractChecked => " " + Dialect.MinusSign + " ",
                    ExpressionType.Multiply => " " + Dialect.MultiplySign + " ",
                    ExpressionType.MultiplyChecked => " " + Dialect.MultiplySign + " ",
                    ExpressionType.Divide => " " + Dialect.DivideSign + " ",
                    _ => throw new NotSupportedException($"Binary operation of type {_expression.NodeType} is not supported")
                }
Esempio n. 2
0
 /// <inheritdoc />
 public override void AppendSql(StringBuilder builder, GeneratorContext filterParams)
 {
     _operation.AppendSql(builder, filterParams);
 }
Esempio n. 3
0
 public override void AppendSql(StringBuilder builder, GeneratorContext filterParams)
 {
     builder.Append(Dialect.NotKeyword + " " + Dialect.OpenBracket);
     _operation.AppendSql(builder, filterParams);
     builder.Append(Dialect.CloseBracket);
 }