예제 #1
0
        protected virtual Expression VisitIf(IFCommand ifx)
        {
            Expression check   = this.Visit(ifx.Check);
            Expression ifTrue  = this.Visit(ifx.IfTrue);
            Expression ifFalse = this.Visit(ifx.IfFalse);

            return(this.UpdateIf(ifx, check, ifTrue, ifFalse));
        }
예제 #2
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);
 }
 protected virtual bool CompareIf(IFCommand x, IFCommand y)
 {
     return((this.Compare(x.Check, y.Check) && this.Compare(x.IfTrue, y.IfTrue)) && this.Compare(x.IfFalse, y.IfFalse));
 }
예제 #4
0
 protected override Expression VisitIf(IFCommand ifx)
 {
     throw new NotSupportedException();
 }
        protected override Expression VisitIf(IFCommand ifx)
        {
            ConditionalExpression exp = Expression.Condition(ifx.Check, ifx.IfTrue, (ifx.IfFalse != null) ? ifx.IfFalse : ((ifx.IfTrue.Type == typeof(int)) ? ((Expression)Expression.Property(this.executor, "RowsAffected")) : ((Expression)Expression.Constant(King.Framework.Linq.TypeHelper.GetDefault(ifx.IfTrue.Type), ifx.IfTrue.Type))));

            return(this.Visit(exp));
        }