EFIngresProvider/SqlGen/SqlGenerator/SqlGeneratorDbExpressionVisitorMembers.cs
/// <summary>
/// The Not expression may cause the translation of its child to change.
/// These children are
/// <list type="bullet">
/// <item><see cref="DbNotExpression"/>NOT(Not(x)) becomes x</item>
/// <item><see cref="DbIsEmptyExpression"/>NOT EXISTS becomes EXISTS</item>
/// <item><see cref="DbIsNullExpression"/>IS NULL becomes IS NOT NULL</item>
/// <item><see cref="DbComparisonExpression"/>= becomes&lt;&gt; </item>
/// </list>
/// </summary>
/// <param name="e"></param>
/// <returns>A <see cref="SqlBuilder"/></returns>
The Not expression may cause the translation of its child to change.
The Not expression may cause the translation of its child to change .
public override ISqlFragment Visit(DbNotExpression e)
        {
            if (e.Argument is DbNotExpression)
            {
                return ((DbNotExpression)e.Argument).Argument.Accept(this);
            }
            if (e.Argument is DbIsEmptyExpression)
            {
                return VisitIsEmptyExpression((DbIsEmptyExpression)e.Argument, true);
            }
            if (e.Argument is DbIsNullExpression)
            {
                return VisitIsNullExpression((DbIsNullExpression)e.Argument, true);
            }
            if (e.Argument is DbComparisonExpression)
            {
                var comparisonExpression = (DbComparisonExpression)e.Argument;
                if (comparisonExpression.ExpressionKind == DbExpressionKind.Equals)
                {
                    return VisitBinaryExpression("<>", comparisonExpression.Left, comparisonExpression.Right);
                }
            }
            return new SqlBuilder(" not (", e.Argument.Accept(this), ")");
        }
public override ISqlFragment Visit ( DbNotExpression e ) { if ( e . Argument is DbNotExpression ) { return ( ( DbNotExpression ) e . Argument ) . Argument . Accept ( this ) ; } if ( e . Argument is DbIsEmptyExpression ) { return VisitIsEmptyExpression ( ( DbIsEmptyExpression ) e . Argument , true ) ; } if ( e . Argument is DbIsNullExpression ) { return VisitIsNullExpression ( ( DbIsNullExpression ) e . Argument , true ) ; } if ( e . Argument is DbComparisonExpression ) { var comparisonExpression = ( DbComparisonExpression ) e . Argument ; if ( comparisonExpression . ExpressionKind == DbExpressionKind . Equals ) { return VisitBinaryExpression ( " " , comparisonExpression . Left , comparisonExpression . Right ) ; } } return new SqlBuilder ( " " , e . Argument . Accept ( this ) , " " ) ; }
The Not expression may cause the translation of its child to change.
The Not expression may cause the translation of its child to change .
// Flatten Not(Not(x)) to x.
None
e
DbNotExpression
None