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); }
public QueryObject And(FilterNode filterNode) { if (WhereClause == null) { WhereClause = filterNode; } else { WhereClause = new FilterNode(WhereClause, Operator.AND.ToString(), filterNode); } return(this); }
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); }
public SelectTerm(FilterNode node, String alias) { this.node = node; this.alias = alias; }
public FilterNode(FilterNode left, string op, FilterNode right) { this.Left = left; this.Op = op; this.Right = right; }
public OrderNode(FilterNode node, OrderTerm term) { this.filterNode = node; this.term = term; }
/** * 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); }