Beispiel #1
0
        private void VisitLikeExpression(Operator @operator)
        {
            _sql.OpenBlock.Trim();
            var function  = @operator.LeftOperand.Projection.Function;
            var condition = (bool)@operator.RightOperand.Projection.Constant.Value;

            switch (function.Type)
            {
            case Function.FunctionType.StartsWith:
                _sql.StartsWith(condition,
                                x => VisitProjection(function.StartsWith.Text),
                                x => VisitProjection(function.StartsWith.Value));
                break;

            case Function.FunctionType.Contains:
                _sql.Contains(condition,
                              x => VisitProjection(function.Contains.Text),
                              x => VisitProjection(function.Contains.Value));
                break;

            case Function.FunctionType.EndsWith:
                _sql.EndsWith(condition,
                              x => VisitProjection(function.EndsWith.Text),
                              x => VisitProjection(function.EndsWith.Value));
                break;
            }
            _sql.Trim().CloseBlock.Flush();
        }