コード例 #1
0
        public ListRequest addOrderBy(FilterNode node, Boolean isAsc)
        {
            if (QueryObject.OrderByTermList == null)
            {
                QueryObject.OrderByTermList = new List <OrderNode>();
            }

            QueryObject.OrderByTermList.Add(
                new OrderNode(node, isAsc ? OrderTerm.ASC : OrderTerm.DESC));

            return(this);
        }
コード例 #2
0
 public QueryObject And(FilterNode filterNode)
 {
     if (WhereClause == null)
     {
         WhereClause = filterNode;
     }
     else
     {
         WhereClause = new FilterNode(WhereClause, Operator.AND.ToString(), filterNode);
     }
     return(this);
 }
コード例 #3
0
        public static FilterNode or(params FilterNode[] filterNodes)
        {
            if (filterNodes == null || filterNodes.Length < 2)
            {
                throw new Exception("At least two operands are needed for AND");
            }

            FilterNode result = null;

            foreach (FilterNode node in filterNodes)
            {
                if (result == null)
                {
                    result = node;
                }
                else
                {
                    FilterNode temp = new FilterNode(result, Operator.OR.ToString(), node);
                    result = temp;
                }
            }
            return(result);
        }
コード例 #4
0
 public SelectTerm(FilterNode node, String alias)
 {
     this.node  = node;
     this.alias = alias;
 }
コード例 #5
0
 public FilterNode(FilterNode left, string op, FilterNode right)
 {
     this.Left  = left;
     this.Op    = op;
     this.Right = right;
 }
コード例 #6
0
 public OrderNode(FilterNode node, OrderTerm term)
 {
     this.filterNode = node;
     this.term       = term;
 }
コード例 #7
0
 /**
  * exactly same as "and" function, addCondition is just more user-friendly name
  * @param filter
  * @return
  */
 public ListRequest and(FilterNode filter)
 {
     QueryObject.And(filter);
     return(this);
 }