protected virtual Expression VisitIf(DbIFCommand ifx) { var check = this.Visit(ifx.Check); var ifTrue = this.Visit(ifx.IfTrue); var ifFalse = this.Visit(ifx.IfFalse); return(this.UpdateIf(ifx, check, ifTrue, ifFalse)); }
protected DbIFCommand UpdateIf(DbIFCommand ifx, Expression check, Expression ifTrue, Expression ifFalse) { if (check != ifx.Check || ifTrue != ifx.IfTrue || ifFalse != ifx.IfFalse) { return(new DbIFCommand(check, ifTrue, ifFalse)); } return(ifx); }
protected override Expression VisitIf(DbIFCommand ifx) { var test = Expression.Condition ( ifx.Check, ifx.IfTrue, ifx.IfFalse ?? (ifx.IfTrue.Type == typeof(int) ? Expression.Property(this.executor, nameof(QueryExecutor.RowsAffected)) as Expression : Expression.Constant(TypeHelper.GetDefault(ifx.IfTrue.Type), ifx.IfTrue.Type) as Expression) ); return(this.Visit(test)); }
protected virtual bool CompareIf(DbIFCommand x, DbIFCommand y) { return(this.Compare(x.Check, y.Check) && this.Compare(x.IfTrue, y.IfTrue) && this.Compare(x.IfFalse, y.IfFalse)); }
protected override Expression VisitIf(DbIFCommand ifx) { throw new NotSupportedException(); }