public static QueryExpresion Append(this QueryExpresion expr, string junction, string nextExpression) { if (!string.IsNullOrEmpty(nextExpression) && !string.IsNullOrEmpty(junction)) { expr.Junction = junction; expr.Last().NextExpression = new QueryExpresion(nextExpression); } return(expr); }
public static QueryExpresion And(this QueryExpresion expr, string nextExpression) { if (!string.IsNullOrEmpty(nextExpression)) { expr.Junction = SqlUtil.AND; expr.Last().NextExpression = new QueryExpresion(SqlUtil.AND, nextExpression); } return(expr); }
/// <summary> /// Returns the last expression of the query string /// </summary> /// <param name="expr"></param> /// <returns></returns> public static QueryExpresion Last(this QueryExpresion expr) { QueryExpresion result = expr; while (expr.NextExpression != null) { result = expr.NextExpression; expr = result; } return(result); }
public virtual string ToString(QueryExpresion last) { return(last.ToString()); }