示例#1
0
 protected IFCommand UpdateIf(IFCommand ifx, Expression check, Expression ifTrue, Expression ifFalse)
 {
     if (check != ifx.Check || ifTrue != ifx.IfTrue || ifFalse != ifx.IfFalse)
     {
         return(new IFCommand(check, ifTrue, ifFalse));
     }
     return(ifx);
 }
示例#2
0
        protected virtual Expression VisitIf(IFCommand ifx)
        {
            Expression check   = Visit(ifx.Check);
            Expression ifTrue  = Visit(ifx.IfTrue);
            Expression ifFalse = Visit(ifx.IfFalse);

            return(UpdateIf(ifx, check, ifTrue, ifFalse));
        }
示例#3
0
        protected override Expression VisitIf(IFCommand ifx)
        {
            ConditionalExpression test = Expression.Condition(ifx.Check, ifx.IfTrue,
                                                              ifx.IfFalse != null
                                                                  ? ifx.IfFalse
                                                                  : ifx.IfTrue.Type == typeof(int)
                                                                        ? Expression.Property(executor, "RowsAffected")
                                                                        : (Expression)Expression.Constant(TypeHelper.GetDefault(ifx.IfTrue.Type), ifx.IfTrue.Type));

            return(Visit(test));
        }
示例#4
0
 protected virtual bool CompareIf(IFCommand x, IFCommand y)
 {
     return(Compare(x.Check, y.Check) && Compare(x.IfTrue, y.IfTrue) && Compare(x.IfFalse, y.IfFalse));
 }
示例#5
0
 protected override Expression VisitIf(IFCommand ifx)
 {
     throw new NotSupportedException();
 }