public bool VisitExprOrderByItem(ExprOrderByItem expr, TCtx arg) { var res = this.Visit(expr, "OrderByItem", arg, out var argOut) && this.Accept("Value", expr.Value, argOut); this.VisitPlainProperty("Descendant", expr.Descendant, argOut); this._visitor.EndVisitExpr(expr, arg); return(res); }
public bool VisitExprOrderByItem(ExprOrderByItem exprOrderByItem, IExpr?parent) { exprOrderByItem.Value.Accept(this, exprOrderByItem); if (exprOrderByItem.Descendant) { this.Builder.Append(" DESC"); } return(true); }
protected ISelectBuilder OrderByInternal(ExprOrderByItem item, params ExprOrderByItem[] rest) { if (this._orderBy.HasValue) { throw new SqExpressException("Order has already been set"); } this._orderBy = new OrderByStorage(Helpers.Combine(item, rest), null); return(this); }
public static ExprOrderByItem WithDescendant(this ExprOrderByItem original, Boolean newDescendant) => new ExprOrderByItem(value: original.Value, descendant: newDescendant);
public static ExprOrderByItem WithValue(this ExprOrderByItem original, ExprValue newValue) => new ExprOrderByItem(value: newValue, descendant: original.Descendant);
public ISelectBuilder OrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest) => this.OrderByInternal(item, rest);
protected ISelectBuilder OrderByInternal(ExprOrderByItem item, params ExprOrderByItem[] rest) { this._orderItems.AssertFatalNull(nameof(this._orderItems)); this._orderItems = Helpers.Combine(item, rest); return(this); }
public ISelectBuilder OrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest) { return(this.OrderByInternal(item, rest)); }
public AnalyticFunctionOverFrameBuilder OverOrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest) => new AnalyticFunctionOverFrameBuilder(this._name, this._arguments, this._partitions, Helpers.Combine(item, rest));
public ExprAnalyticFunction OverOrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest) => new ExprAnalyticFunction(new ExprFunctionName(true, this._name), this._arguments, new ExprOver(this._partitions, new ExprOrderBy(Helpers.Combine(item, rest)), null));
public static ExprSelect AddOrderBy(this IExprSubQuery original, ExprOrderByItem orderBy, params ExprOrderByItem[] rest) => new ExprSelect(original, new ExprOrderBy(Helpers.Combine(orderBy, rest)));