Exemplo n.º 1
0
        private string ResolveOrder()
        {
            var buffer = new StringBuilder();

            foreach (var item in _orderExpressions)
            {
                if (item == _orderExpressions.First())
                {
                    buffer.Append($" ORDER BY ");
                }
                var result = new OrderExpressionResovle(item.Expression, item.Asc).Resovle();
                buffer.Append(result);
                buffer.Append(",");
            }
            return(buffer.ToString().Trim(','));
        }
Exemplo n.º 2
0
        protected string BuildOrderExpression()
        {
            var buffer      = new StringBuilder();
            var expressions = _expressions.GetOrderExpressions();
            var first       = true;

            foreach (var item in expressions)
            {
                if (first)
                {
                    first = false;
                    buffer.Append($" ORDER BY ");
                }
                var result = new OrderExpressionResovle(_isSingleTable, item.Expression, item.Asc).Resovle();
                buffer.Append(result);
                buffer.Append(',');
            }
            return(buffer.ToString().Trim(','));
        }