internal protected void OrderBy() { var dic = DC.Parameters.FirstOrDefault(it => it.Action == ActionEnum.From); var tbm = DC.XC.GetTableModel(dic != null ? dic.TbMType : DC.TbM1); if (DC.Parameters.Any(it => it.Action == ActionEnum.OrderBy)) { CRLF(X); X.Append("order by"); Spacing(X); OrderByParams(); } else { if (!IsPaging(DC)) { return; } var col = DbSql.GetIndex(tbm.TbCols); if (col != null) { CRLF(X); X.Append("order by"); Spacing(X); if (DC.Crud == CrudEnum.Join) { DbSql.Column(dic.TbAlias, col.ColumnName, X); Spacing(X); X.Append("desc"); } else { DbSql.Column(string.Empty, col.ColumnName, X); Spacing(X); X.Append("desc"); } } } }