示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
        /// <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);
        }
示例#4
0
 public virtual string ToString(QueryExpresion last)
 {
     return(last.ToString());
 }